diff --git a/README.md b/README.md index 9975998..9fec258 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ Redeploy TWABRewards on Avalanche, Ethereum and Polygon. Deploy USDC Prize Pool on Optimism. -### v1.6.0 Post-Deploy Configuration Changes +### Post-Deploy Configuration Changes #### Optimism @@ -144,3 +144,19 @@ Executive team needs to claim ownership of the following contracts: - PrizeDistributionBuffer - ReceiverTimelockTrigger +## v1.6.1 + +Re-deploy USDC Prize Pool on Optimism. + +## v1.7.0 + +Deploy RNGChainlinkV2 on Polygon and setup DrawBeacon to compute draw onchain. + +### Post-Deploy Configuration Changes + +#### Polygon + +Executive team needs to claim ownership of the following contracts: +- RNGChainlinkV2 +- DrawBeacon +- BeaconTimelockTrigger diff --git a/contracts.json b/contracts.json index a8abae5..70f41d1 100644 --- a/contracts.json +++ b/contracts.json @@ -1 +1 @@ -{"name":"PoolTogether V4 Mainnet","version":{"major":1,"minor":6,"patch":1},"tags":{},"contracts":[{"chainId":1,"address":"0x32e8D4c9d1B711BC958d0Ce8D14b41F77Bb03a64","version":{"major":1,"minor":6,"patch":1},"type":"ATokenYieldSource","abi":[{"inputs":[{"internalType":"contract ATokenInterface","name":"_aToken","type":"address"},{"internalType":"contract IAaveIncentivesController","name":"_incentivesController","type":"address"},{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"_lendingPoolAddressesProviderRegistry","type":"address"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAToken","name":"aToken","type":"address"},{"indexed":false,"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"lendingPoolAddressesProviderRegistry","type":"address"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"ATokenYieldSourceInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sponsored","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SuppliedTokenTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TransferredERC20","type":"event"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract ATokenInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approveMaxAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"claimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incentivesController","outputs":[{"internalType":"contract IAaveIncentivesController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lendingPoolAddressesProviderRegistry","outputs":[{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sponsor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"supplyTokenTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x6C04Eeeed2dEFedbC9A0f3f63bf14F39a189F607","version":{"major":1,"minor":6,"patch":1},"type":"BeaconTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x0D33612870cd9A475bBBbB7CC38fC66680dEcAC5","version":{"major":1,"minor":6,"patch":1},"type":"DrawBeacon","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract RNGInterface","name":"_rng","type":"address"},{"internalType":"uint32","name":"_nextDrawId","type":"uint32"},{"internalType":"uint64","name":"_beaconPeriodStart","type":"uint64"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint32","name":"_rngTimeout","type":"uint32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"drawPeriodSeconds","type":"uint32"}],"name":"BeaconPeriodSecondsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"startedAt","type":"uint64"}],"name":"BeaconPeriodStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"nextDrawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"newDrawBuffer","type":"address"}],"name":"DrawBufferUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"rngRequestId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"rngLockBlock","type":"uint32"}],"name":"DrawCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"DrawCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"rngRequestId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"rngLockBlock","type":"uint32"}],"name":"DrawStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract RNGInterface","name":"rngService","type":"address"}],"name":"RngServiceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"rngTimeout","type":"uint32"}],"name":"RngTimeoutSet","type":"event"},{"inputs":[],"name":"beaconPeriodEndAt","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beaconPeriodRemainingSeconds","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_time","type":"uint64"}],"name":"calculateNextBeaconPeriodStartTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculateNextBeaconPeriodStartTimeFromCurrentTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canCompleteDraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canStartDraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"completeDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBeaconPeriodSeconds","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBeaconPeriodStartedAt","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRngLockBlock","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRngRequestId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRngService","outputs":[{"internalType":"contract RNGInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRngTimeout","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isBeaconPeriodOver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngCompleted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngRequested","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngTimedOut","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"}],"name":"setBeaconPeriodSeconds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawBuffer","name":"newDrawBuffer","type":"address"}],"name":"setDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract RNGInterface","name":"_rngService","type":"address"}],"name":"setRngService","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_rngTimeout","type":"uint32"}],"name":"setRngTimeout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x78Ea5a9595279DC2F9608283875571b1151F19D4","version":{"major":1,"minor":6,"patch":1},"type":"DrawBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"}],"name":"DrawSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_CARDINALITY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getDraws","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"}],"name":"pushDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_newDraw","type":"tuple"}],"name":"setDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x14d0675580C7255043a3AeD3726F5D7f33292730","version":{"major":1,"minor":6,"patch":1},"type":"DrawCalculator","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract PrizeDistributor","name":"prizeDistributor","type":"address"}],"name":"PrizeDistributorSet","type":"event"},{"inputs":[],"name":"TIERS_LENGTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_pickIndicesForDraws","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getNormalizedBalancesForDrawIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x1DcaD946D10343cc4494D610d6273153FB071772","version":{"major":1,"minor":6,"patch":1},"type":"DrawCalculatorTimelock","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawCalculator","name":"_calculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"drawCalculator","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"LockedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"indexed":false,"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"timelock","type":"tuple"}],"name":"TimelockSet","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint32[]","name":"drawIds","type":"uint32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimelock","outputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasElapsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint64","name":"_timestamp","type":"uint64"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"_timelock","type":"tuple"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xdC90a79fcb1DBAd5F05E6C264F84AC4b0d351F94","version":{"major":1,"minor":6,"patch":1},"type":"L1TimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionPushed","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xf025a8d9E6080F885e841C8cC0E324368D7C6577","version":{"major":1,"minor":6,"patch":1},"type":"PrizeDistributionBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"cardinality","type":"uint8"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeDistributions","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"pushPrizeDistribution","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"setPrizeDistribution","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x35A0dF72E1ea94B52F9EbE0D515928eCb663f39F","version":{"major":1,"minor":6,"patch":1},"type":"PrizeDistributionFactory","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeTierHistory","name":"_prizeTierHistory","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_minPickCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"calculatePrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint64","name":"_drawTimestamp","type":"uint64"}],"name":"calculatePrizeDistributionWithDrawData","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPickCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeTierHistory","outputs":[{"internalType":"contract IPrizeTierHistory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"pushPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"setPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xb9a179DcA5a7bf5f8B9E088437B3A85ebB495eFe","version":{"major":1,"minor":6,"patch":1},"type":"PrizeDistributor","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IDrawCalculator","name":"_drawCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"ClaimedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"calculator","type":"address"}],"name":"DrawCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TokenSet","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getDrawPayoutBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawCalculator","name":"_newCalculator","type":"address"}],"name":"setDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x2193b28b2BdfBf805506C9D91Ed2021bA6fBc888","version":{"major":1,"minor":6,"patch":1},"type":"PrizeFlush","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":true,"internalType":"contract IReserve","name":"reserve","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"DestinationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Flushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IReserve","name":"reserve","type":"address"}],"name":"ReserveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"StrategySet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_destination","type":"address"}],"name":"setDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"name":"setReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStrategy","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x47a5ABfAcDebf5af312B034B3b748935A0259136","version":{"major":1,"minor":6,"patch":1},"type":"PrizeSplitStrategy","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IPrizePool","name":"prizePool","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalPrizeCaptured","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeAwarded","type":"uint256"},{"indexed":true,"internalType":"contract IControlledToken","name":"token","type":"address"}],"name":"PrizeSplitAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"target","type":"uint256"}],"name":"PrizeSplitRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint16","name":"percentage","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"PrizeSplitSet","type":"event"},{"inputs":[],"name":"ONE_AS_FIXED_POINT_3","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPrizePool","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizeSplitIndex","type":"uint256"}],"name":"getPrizeSplit","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeSplits","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"_prizeSplit","type":"tuple"},{"internalType":"uint8","name":"_prizeSplitIndex","type":"uint8"}],"name":"setPrizeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"_newPrizeSplits","type":"tuple[]"}],"name":"setPrizeSplits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x24C3e15BdC10Ce2CB1BEc56cd43F397cE9B89430","version":{"major":1,"minor":6,"patch":1},"type":"PrizeTierHistory","abi":[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getPrizeTier","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPrizeTierAtIndex","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeTierList","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"popAndPush","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"nextPrizeTier","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"replace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x3A06B40C67515cda47E44b57116488F73A441F72","version":{"major":1,"minor":6,"patch":1},"type":"RNGChainlinkV2","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract VRFCoordinatorV2Interface","name":"_vrfCoordinator","type":"address"},{"internalType":"uint64","name":"_subscriptionId","type":"uint64"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"keyHash","type":"bytes32"}],"name":"KeyHashSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"requestId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"RandomNumberCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"requestId","type":"uint32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RandomNumberRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"subscriptionId","type":"uint64"}],"name":"SubscriptionIdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract VRFCoordinatorV2Interface","name":"vrfCoordinator","type":"address"}],"name":"VrfCoordinatorSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getKeyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRequestId","outputs":[{"internalType":"uint32","name":"requestId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRequestFee","outputs":[{"internalType":"address","name":"feeToken","type":"address"},{"internalType":"uint256","name":"requestFee","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getSubscriptionId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVrfCoordinator","outputs":[{"internalType":"contract VRFCoordinatorV2Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_internalRequestId","type":"uint32"}],"name":"isRequestComplete","outputs":[{"internalType":"bool","name":"isCompleted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_internalRequestId","type":"uint32"}],"name":"randomNumber","outputs":[{"internalType":"uint256","name":"randomNum","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestRandomNumber","outputs":[{"internalType":"uint32","name":"requestId","type":"uint32"},{"internalType":"uint32","name":"lockBlock","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"name":"setKeyhash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_subscriptionId","type":"uint64"}],"name":"setSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xadB4D93D84b18b5D82063aCf58b21587c92fdfb5","version":{"major":1,"minor":6,"patch":1},"type":"Reserve","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserveAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAccumulated","type":"uint256"}],"name":"Checkpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"getReserveAccumulatedBetween","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAccumulator","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x5cFbEE38362B9A60be276763753f64245EA990F7","version":{"major":1,"minor":6,"patch":1},"type":"TWABDelegator","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegateeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"contract Delegation","name":"delegation","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegationCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFundedFromStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"RepresentativeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDelegation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WithdrewDelegationToStake","type":"event"},{"inputs":[],"name":"MAX_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"computeDelegationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"createDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationInstance","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegationFromStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"getDelegation","outputs":[{"internalType":"contract Delegation","name":"delegation","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"},{"internalType":"bool","name":"wasCreated","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"address","name":"_representative","type":"address"}],"name":"isRepresentativeOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitAndMulticall.Signature","name":"_permitSignature","type":"tuple"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"permitAndMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_representative","type":"address"},{"internalType":"bool","name":"_set","type":"bool"}],"name":"setRepresentative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferDelegationTo","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"updateDelegatee","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawDelegationToStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xdd4d117723C257CEe402285D3aCF218E9A8236E1","version":{"major":1,"minor":6,"patch":1},"type":"Ticket","abi":[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegate","type":"address"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTotalSupplyTwab","type":"tuple"}],"name":"NewTotalSupplyTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTwab","type":"tuple"}],"name":"NewUserTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"TicketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"controllerDelegateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"delegateOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_newDelegate","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"delegateWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAccountDetails","outputs":[{"components":[{"internalType":"uint208","name":"balance","type":"uint208"},{"internalType":"uint24","name":"nextTwabIndex","type":"uint24"},{"internalType":"uint24","name":"cardinality","type":"uint24"}],"internalType":"struct TwabLib.AccountDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_startTime","type":"uint64"},{"internalType":"uint64","name":"_endTime","type":"uint64"}],"name":"getAverageBalanceBetween","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageBalancesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageTotalSuppliesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getBalanceAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getBalancesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getTotalSuppliesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getTotalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"getTwab","outputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct ObservationLib.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xe7934EE0c8b877269A5688ee26dd853785212618","version":{"major":1,"minor":6,"patch":1},"type":"TwabRewards","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"}],"name":"PromotionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PromotionDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"epochNumber","type":"uint8"}],"name":"PromotionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"PromotionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint8[]","name":"epochIds","type":"uint8[]"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint256","name":"_tokensPerEpoch","type":"uint256"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"createPromotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"destroyPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"endPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"extendPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getCurrentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getPromotion","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint8","name":"numberOfEpochs","type":"uint8"},{"internalType":"uint48","name":"epochDuration","type":"uint48"},{"internalType":"uint48","name":"createdAt","type":"uint48"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokensPerEpoch","type":"uint256"},{"internalType":"uint256","name":"rewardsUnclaimed","type":"uint256"}],"internalType":"struct ITwabRewards.Promotion","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getRemainingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"getRewardsAmount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xd89a09084555a7D0ABe7B111b1f78DFEdDd638Be","version":{"major":1,"minor":6,"patch":1},"type":"YieldSourcePrizePool","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IYieldSource","name":"_yieldSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Awarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardedExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balanceCap","type":"uint256"}],"name":"BalanceCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"}],"name":"ControlledTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"yieldSource","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"liquidityCap","type":"uint256"}],"name":"LiquidityCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prizeStrategy","type":"address"}],"name":"PrizeStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferredExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemed","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"award","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"awardExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"awardExternalERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_externalToken","type":"address"}],"name":"canAwardExternal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureAwardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICompLike","name":"_compLike","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"compLikeDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_delegate","type":"address"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccountedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_controlledToken","type":"address"}],"name":"isControlled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balanceCap","type":"uint256"}],"name":"setBalanceCap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityCap","type":"uint256"}],"name":"setLiquidityCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prizeStrategy","type":"address"}],"name":"setPrizeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"name":"setTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldSource","outputs":[{"internalType":"contract IYieldSource","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xD4F6d570133401079D213EcF4A14FA0B4bfB5b9C","version":{"major":1,"minor":6,"patch":1},"type":"ATokenYieldSource","abi":[{"inputs":[{"internalType":"contract ATokenInterface","name":"_aToken","type":"address"},{"internalType":"contract IAaveIncentivesController","name":"_incentivesController","type":"address"},{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"_lendingPoolAddressesProviderRegistry","type":"address"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAToken","name":"aToken","type":"address"},{"indexed":false,"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"lendingPoolAddressesProviderRegistry","type":"address"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"ATokenYieldSourceInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sponsored","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SuppliedTokenTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TransferredERC20","type":"event"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract ATokenInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approveMaxAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"claimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incentivesController","outputs":[{"internalType":"contract IAaveIncentivesController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lendingPoolAddressesProviderRegistry","outputs":[{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sponsor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"supplyTokenTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x44B1d66E7B9d4467139924f31754F34cbC392f44","version":{"major":1,"minor":6,"patch":1},"type":"DrawBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"}],"name":"DrawSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_CARDINALITY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getDraws","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"}],"name":"pushDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_newDraw","type":"tuple"}],"name":"setDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x3976BD6F4B82C97314570A77bc1e979f7A839A24","version":{"major":1,"minor":6,"patch":1},"type":"DrawCalculator","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract PrizeDistributor","name":"prizeDistributor","type":"address"}],"name":"PrizeDistributorSet","type":"event"},{"inputs":[],"name":"TIERS_LENGTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_pickIndicesForDraws","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getNormalizedBalancesForDrawIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x0C22044B0aA634e26C5B5e50E2B958C7aF59c161","version":{"major":1,"minor":6,"patch":1},"type":"DrawCalculatorTimelock","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawCalculator","name":"_calculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"drawCalculator","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"LockedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"indexed":false,"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"timelock","type":"tuple"}],"name":"TimelockSet","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint32[]","name":"drawIds","type":"uint32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimelock","outputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasElapsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint64","name":"_timestamp","type":"uint64"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"_timelock","type":"tuple"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xc366bF1a054CA495c09B1A722D863ac65746138E","version":{"major":1,"minor":6,"patch":1},"type":"L2TimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"DrawAndPrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xcf6030BDEaB4E503D186426510aD88C1DA7125A3","version":{"major":1,"minor":6,"patch":1},"type":"PrizeDistributionBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"cardinality","type":"uint8"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeDistributions","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"pushPrizeDistribution","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"setPrizeDistribution","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x38004713B1793f00c5B497E3eCC1a50697e5FfaE","version":{"major":1,"minor":6,"patch":1},"type":"PrizeDistributionFactory","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeTierHistory","name":"_prizeTierHistory","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_minPickCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"calculatePrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint64","name":"_drawTimestamp","type":"uint64"}],"name":"calculatePrizeDistributionWithDrawData","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPickCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeTierHistory","outputs":[{"internalType":"contract IPrizeTierHistory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"pushPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"setPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x8141BcFBcEE654c5dE17C4e2B2AF26B67f9B9056","version":{"major":1,"minor":6,"patch":1},"type":"PrizeDistributor","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IDrawCalculator","name":"_drawCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"ClaimedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"calculator","type":"address"}],"name":"DrawCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TokenSet","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getDrawPayoutBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawCalculator","name":"_newCalculator","type":"address"}],"name":"setDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xA2342489470474536F04cd4DdA2e8658303b305d","version":{"major":1,"minor":6,"patch":1},"type":"PrizeFlush","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":true,"internalType":"contract IReserve","name":"reserve","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"DestinationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Flushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IReserve","name":"reserve","type":"address"}],"name":"ReserveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"StrategySet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_destination","type":"address"}],"name":"setDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"name":"setReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStrategy","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x879e176Ae9Fe9B00c30f4827364eA9e4fB35858D","version":{"major":1,"minor":6,"patch":1},"type":"PrizeSplitStrategy","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IPrizePool","name":"prizePool","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalPrizeCaptured","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeAwarded","type":"uint256"},{"indexed":true,"internalType":"contract IControlledToken","name":"token","type":"address"}],"name":"PrizeSplitAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"target","type":"uint256"}],"name":"PrizeSplitRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint16","name":"percentage","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"PrizeSplitSet","type":"event"},{"inputs":[],"name":"ONE_AS_FIXED_POINT_3","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPrizePool","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizeSplitIndex","type":"uint256"}],"name":"getPrizeSplit","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeSplits","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"_prizeSplit","type":"tuple"},{"internalType":"uint8","name":"_prizeSplitIndex","type":"uint8"}],"name":"setPrizeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"_newPrizeSplits","type":"tuple[]"}],"name":"setPrizeSplits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x1DcaD946D10343cc4494D610d6273153FB071772","version":{"major":1,"minor":6,"patch":1},"type":"PrizeTierHistory","abi":[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getPrizeTier","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPrizeTierAtIndex","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeTierList","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"popAndPush","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"nextPrizeTier","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"replace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x0F3137E09349449b62144f0918135dE548FdFeeE","version":{"major":1,"minor":6,"patch":1},"type":"ReceiverTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedPushedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xCE148f6acFee9FEFb42A736B4976e657f35982b8","version":{"major":1,"minor":6,"patch":1},"type":"Reserve","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserveAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAccumulated","type":"uint256"}],"name":"Checkpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"getReserveAccumulatedBetween","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAccumulator","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x89Ee77Ce3F4C1b0346FF96E3004ff7C9f972dEF8","version":{"major":1,"minor":6,"patch":1},"type":"TWABDelegator","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegateeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"contract Delegation","name":"delegation","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegationCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFundedFromStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"RepresentativeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDelegation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WithdrewDelegationToStake","type":"event"},{"inputs":[],"name":"MAX_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"computeDelegationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"createDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationInstance","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegationFromStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"getDelegation","outputs":[{"internalType":"contract Delegation","name":"delegation","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"},{"internalType":"bool","name":"wasCreated","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"address","name":"_representative","type":"address"}],"name":"isRepresentativeOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitAndMulticall.Signature","name":"_permitSignature","type":"tuple"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"permitAndMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_representative","type":"address"},{"internalType":"bool","name":"_set","type":"bool"}],"name":"setRepresentative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferDelegationTo","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"updateDelegatee","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawDelegationToStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x6a304dFdb9f808741244b6bfEe65ca7B3b3A6076","version":{"major":1,"minor":6,"patch":1},"type":"Ticket","abi":[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegate","type":"address"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTotalSupplyTwab","type":"tuple"}],"name":"NewTotalSupplyTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTwab","type":"tuple"}],"name":"NewUserTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"TicketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"controllerDelegateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"delegateOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_newDelegate","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"delegateWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAccountDetails","outputs":[{"components":[{"internalType":"uint208","name":"balance","type":"uint208"},{"internalType":"uint24","name":"nextTwabIndex","type":"uint24"},{"internalType":"uint24","name":"cardinality","type":"uint24"}],"internalType":"struct TwabLib.AccountDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_startTime","type":"uint64"},{"internalType":"uint64","name":"_endTime","type":"uint64"}],"name":"getAverageBalanceBetween","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageBalancesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageTotalSuppliesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getBalanceAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getBalancesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getTotalSuppliesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getTotalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"getTwab","outputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct ObservationLib.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x1470c87e2db5247A36C60DE3D65D7C972C62EA0f","version":{"major":1,"minor":6,"patch":1},"type":"TwabRewards","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"}],"name":"PromotionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PromotionDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"epochNumber","type":"uint8"}],"name":"PromotionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"PromotionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint8[]","name":"epochIds","type":"uint8[]"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint256","name":"_tokensPerEpoch","type":"uint256"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"createPromotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"destroyPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"endPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"extendPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getCurrentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getPromotion","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint8","name":"numberOfEpochs","type":"uint8"},{"internalType":"uint48","name":"epochDuration","type":"uint48"},{"internalType":"uint48","name":"createdAt","type":"uint48"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokensPerEpoch","type":"uint256"},{"internalType":"uint256","name":"rewardsUnclaimed","type":"uint256"}],"internalType":"struct ITwabRewards.Promotion","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getRemainingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"getRewardsAmount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x19DE635fb3678D8B8154E37d8C9Cdf182Fe84E60","version":{"major":1,"minor":6,"patch":1},"type":"YieldSourcePrizePool","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IYieldSource","name":"_yieldSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Awarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardedExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balanceCap","type":"uint256"}],"name":"BalanceCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"}],"name":"ControlledTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"yieldSource","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"liquidityCap","type":"uint256"}],"name":"LiquidityCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prizeStrategy","type":"address"}],"name":"PrizeStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferredExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemed","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"award","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"awardExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"awardExternalERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_externalToken","type":"address"}],"name":"canAwardExternal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureAwardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICompLike","name":"_compLike","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"compLikeDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_delegate","type":"address"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccountedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_controlledToken","type":"address"}],"name":"isControlled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balanceCap","type":"uint256"}],"name":"setBalanceCap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityCap","type":"uint256"}],"name":"setLiquidityCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prizeStrategy","type":"address"}],"name":"setPrizeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"name":"setTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldSource","outputs":[{"internalType":"contract IYieldSource","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x7437db21A0dEB844Fa64223e2d6Db569De9648Ff","version":{"major":1,"minor":6,"patch":1},"type":"ATokenYieldSource","abi":[{"inputs":[{"internalType":"contract ATokenInterface","name":"_aToken","type":"address"},{"internalType":"contract IAaveIncentivesController","name":"_incentivesController","type":"address"},{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"_lendingPoolAddressesProviderRegistry","type":"address"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAToken","name":"aToken","type":"address"},{"indexed":false,"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"lendingPoolAddressesProviderRegistry","type":"address"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"ATokenYieldSourceInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sponsored","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SuppliedTokenTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TransferredERC20","type":"event"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract ATokenInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approveMaxAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"claimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incentivesController","outputs":[{"internalType":"contract IAaveIncentivesController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lendingPoolAddressesProviderRegistry","outputs":[{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sponsor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"supplyTokenTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x31bCAF169D25f938A25c2e4C762f3D1D3FA7dB2E","version":{"major":1,"minor":6,"patch":1},"type":"DrawBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"}],"name":"DrawSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_CARDINALITY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getDraws","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"}],"name":"pushDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_newDraw","type":"tuple"}],"name":"setDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x0F5F5EF16465371152fC46C72D06fb0ec9392a47","version":{"major":1,"minor":6,"patch":1},"type":"DrawCalculator","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract PrizeDistributor","name":"prizeDistributor","type":"address"}],"name":"PrizeDistributorSet","type":"event"},{"inputs":[],"name":"TIERS_LENGTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_pickIndicesForDraws","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getNormalizedBalancesForDrawIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x01eE1Ea692773f28c45D63133426f21923C3c2Ba","version":{"major":1,"minor":6,"patch":1},"type":"DrawCalculatorTimelock","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawCalculator","name":"_calculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"drawCalculator","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"LockedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"indexed":false,"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"timelock","type":"tuple"}],"name":"TimelockSet","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint32[]","name":"drawIds","type":"uint32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimelock","outputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasElapsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint64","name":"_timestamp","type":"uint64"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"_timelock","type":"tuple"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xC660A8De5eB9E123E475Ae9A9f62dB62c92a3648","version":{"major":1,"minor":6,"patch":1},"type":"EIP2612PermitAndDeposit","abi":[{"inputs":[{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"components":[{"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"internalType":"struct DelegateSignature","name":"_delegateSignature","type":"tuple"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"_permitSignature","type":"tuple"},{"components":[{"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"internalType":"struct DelegateSignature","name":"_delegateSignature","type":"tuple"}],"name":"permitAndDepositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xC8faa39E06ddB8362cb8E3FFDAdeB5bF7877ECcb","version":{"major":1,"minor":6,"patch":1},"type":"PrizeDistributionBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"cardinality","type":"uint8"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeDistributions","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"pushPrizeDistribution","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"setPrizeDistribution","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x87FCF371D68d2429D57Bf1BadcBEEc3463F0DD37","version":{"major":1,"minor":6,"patch":1},"type":"PrizeDistributionFactory","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeTierHistory","name":"_prizeTierHistory","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_minPickCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"calculatePrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint64","name":"_drawTimestamp","type":"uint64"}],"name":"calculatePrizeDistributionWithDrawData","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPickCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeTierHistory","outputs":[{"internalType":"contract IPrizeTierHistory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"pushPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"setPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x83332F908f403ce795D90f677cE3f382FE73f3D1","version":{"major":1,"minor":6,"patch":1},"type":"PrizeDistributor","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IDrawCalculator","name":"_drawCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"ClaimedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"calculator","type":"address"}],"name":"DrawCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TokenSet","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getDrawPayoutBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawCalculator","name":"_newCalculator","type":"address"}],"name":"setDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x1B20994C3894EcC862e26A9F4EC626A8489DD051","version":{"major":1,"minor":6,"patch":1},"type":"PrizeFlush","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":true,"internalType":"contract IReserve","name":"reserve","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"DestinationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Flushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IReserve","name":"reserve","type":"address"}],"name":"ReserveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"StrategySet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_destination","type":"address"}],"name":"setDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"name":"setReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStrategy","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xA30cB2A488dc616F060a54Ee7971d0bD832547Ec","version":{"major":1,"minor":6,"patch":1},"type":"PrizeSplitStrategy","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IPrizePool","name":"prizePool","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalPrizeCaptured","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeAwarded","type":"uint256"},{"indexed":true,"internalType":"contract IControlledToken","name":"token","type":"address"}],"name":"PrizeSplitAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"target","type":"uint256"}],"name":"PrizeSplitRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint16","name":"percentage","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"PrizeSplitSet","type":"event"},{"inputs":[],"name":"ONE_AS_FIXED_POINT_3","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPrizePool","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizeSplitIndex","type":"uint256"}],"name":"getPrizeSplit","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeSplits","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"_prizeSplit","type":"tuple"},{"internalType":"uint8","name":"_prizeSplitIndex","type":"uint8"}],"name":"setPrizeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"_newPrizeSplits","type":"tuple[]"}],"name":"setPrizeSplits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xC3DAD539E460103c860Bb9Ca547647EDbD4903b6","version":{"major":1,"minor":6,"patch":1},"type":"PrizeTierHistory","abi":[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getPrizeTier","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPrizeTierAtIndex","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeTierList","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"popAndPush","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"nextPrizeTier","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"replace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x832cB306640dD33542dBa08ca1c13DD6686A3a88","version":{"major":1,"minor":6,"patch":1},"type":"ReceiverTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedPushedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xf04E5B81e69Cdc3c08BC5Da64ca053AD46a3d029","version":{"major":1,"minor":6,"patch":1},"type":"Reserve","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserveAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAccumulated","type":"uint256"}],"name":"Checkpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"getReserveAccumulatedBetween","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAccumulator","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xd23723fef8A16B77eaDc1fC822aE4170bA9d4009","version":{"major":1,"minor":6,"patch":1},"type":"TWABDelegator","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegateeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"contract Delegation","name":"delegation","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegationCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFundedFromStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"RepresentativeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDelegation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WithdrewDelegationToStake","type":"event"},{"inputs":[],"name":"MAX_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"computeDelegationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"createDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationInstance","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegationFromStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"getDelegation","outputs":[{"internalType":"contract Delegation","name":"delegation","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"},{"internalType":"bool","name":"wasCreated","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"address","name":"_representative","type":"address"}],"name":"isRepresentativeOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitAndMulticall.Signature","name":"_permitSignature","type":"tuple"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"permitAndMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_representative","type":"address"},{"internalType":"bool","name":"_set","type":"bool"}],"name":"setRepresentative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferDelegationTo","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"updateDelegatee","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawDelegationToStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xB27f379C050f6eD0973A01667458af6eCeBc1d90","version":{"major":1,"minor":6,"patch":1},"type":"Ticket","abi":[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegate","type":"address"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTotalSupplyTwab","type":"tuple"}],"name":"NewTotalSupplyTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTwab","type":"tuple"}],"name":"NewUserTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"TicketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"controllerDelegateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"delegateOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_newDelegate","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"delegateWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAccountDetails","outputs":[{"components":[{"internalType":"uint208","name":"balance","type":"uint208"},{"internalType":"uint24","name":"nextTwabIndex","type":"uint24"},{"internalType":"uint24","name":"cardinality","type":"uint24"}],"internalType":"struct TwabLib.AccountDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_startTime","type":"uint64"},{"internalType":"uint64","name":"_endTime","type":"uint64"}],"name":"getAverageBalanceBetween","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageBalancesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageTotalSuppliesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getBalanceAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getBalancesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getTotalSuppliesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getTotalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"getTwab","outputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct ObservationLib.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x01A1F0699356afeB850f5A80226C35A9319CAf74","version":{"major":1,"minor":6,"patch":1},"type":"TwabRewards","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"}],"name":"PromotionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PromotionDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"epochNumber","type":"uint8"}],"name":"PromotionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"PromotionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint8[]","name":"epochIds","type":"uint8[]"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint256","name":"_tokensPerEpoch","type":"uint256"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"createPromotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"destroyPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"endPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"extendPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getCurrentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getPromotion","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint8","name":"numberOfEpochs","type":"uint8"},{"internalType":"uint48","name":"epochDuration","type":"uint48"},{"internalType":"uint48","name":"createdAt","type":"uint48"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokensPerEpoch","type":"uint256"},{"internalType":"uint256","name":"rewardsUnclaimed","type":"uint256"}],"internalType":"struct ITwabRewards.Promotion","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getRemainingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"getRewardsAmount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xF830F5Cb2422d555EC34178E27094a816c8F95EC","version":{"major":1,"minor":6,"patch":1},"type":"YieldSourcePrizePool","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IYieldSource","name":"_yieldSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Awarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardedExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balanceCap","type":"uint256"}],"name":"BalanceCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"}],"name":"ControlledTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"yieldSource","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"liquidityCap","type":"uint256"}],"name":"LiquidityCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prizeStrategy","type":"address"}],"name":"PrizeStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferredExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemed","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"award","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"awardExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"awardExternalERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_externalToken","type":"address"}],"name":"canAwardExternal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureAwardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICompLike","name":"_compLike","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"compLikeDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_delegate","type":"address"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccountedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_controlledToken","type":"address"}],"name":"isControlled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balanceCap","type":"uint256"}],"name":"setBalanceCap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityCap","type":"uint256"}],"name":"setLiquidityCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prizeStrategy","type":"address"}],"name":"setPrizeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"name":"setTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldSource","outputs":[{"internalType":"contract IYieldSource","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x4ecB5300D9ec6BCA09d66bfd8Dcb532e3192dDA1","version":{"major":1,"minor":6,"patch":1},"type":"AaveV3YieldSource","abi":[{"inputs":[{"internalType":"contract IAToken","name":"_aToken","type":"address"},{"internalType":"contract IRewardsController","name":"_rewardsController","type":"address"},{"internalType":"contract IPoolAddressesProviderRegistry","name":"_poolAddressesProviderRegistry","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAToken","name":"aToken","type":"address"},{"indexed":false,"internalType":"contract IRewardsController","name":"rewardsController","type":"address"},{"indexed":false,"internalType":"contract IPoolAddressesProviderRegistry","name":"poolAddressesProviderRegistry","type":"address"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"AaveV3YieldSourceInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address[]","name":"rewardsList","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"claimedAmounts","type":"uint256[]"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"DecreasedERC20Allowance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"IncreasedERC20Allowance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SuppliedTokenTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TransferredERC20","type":"event"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract IAToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"decreaseERC20Allowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"increaseERC20Allowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolAddressesProviderRegistry","outputs":[{"internalType":"contract IPoolAddressesProviderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_redeemAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsController","outputs":[{"internalType":"contract IRewardsController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_depositAmount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"supplyTokenTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x267DD4034830Bb4ba9314e0471C1dDFD79849777","version":{"major":1,"minor":6,"patch":1},"type":"DrawBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"}],"name":"DrawSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_CARDINALITY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getDraws","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"}],"name":"pushDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_newDraw","type":"tuple"}],"name":"setDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x46d2f8e4D8Ff3d76cf252D89dD9b422f04123D2c","version":{"major":1,"minor":6,"patch":1},"type":"DrawCalculator","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract PrizeDistributor","name":"prizeDistributor","type":"address"}],"name":"PrizeDistributorSet","type":"event"},{"inputs":[],"name":"TIERS_LENGTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_pickIndicesForDraws","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getNormalizedBalancesForDrawIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0xd23723fef8A16B77eaDc1fC822aE4170bA9d4009","version":{"major":1,"minor":6,"patch":1},"type":"DrawCalculatorTimelock","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawCalculator","name":"_calculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"drawCalculator","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"LockedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"indexed":false,"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"timelock","type":"tuple"}],"name":"TimelockSet","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint32[]","name":"drawIds","type":"uint32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimelock","outputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasElapsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint64","name":"_timestamp","type":"uint64"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"_timelock","type":"tuple"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0xcddfa3BfC0e548d9A526E3355FefDf987F4e1aAE","version":{"major":1,"minor":6,"patch":1},"type":"EIP2612PermitAndDeposit","abi":[{"inputs":[{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"components":[{"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"internalType":"struct DelegateSignature","name":"_delegateSignature","type":"tuple"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"_permitSignature","type":"tuple"},{"components":[{"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"internalType":"struct DelegateSignature","name":"_delegateSignature","type":"tuple"}],"name":"permitAndDepositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x8e4F3098192948E342fB11ED7C4a23CD5A306973","version":{"major":1,"minor":6,"patch":1},"type":"PrizeDistributionBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"cardinality","type":"uint8"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeDistributions","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"pushPrizeDistribution","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"setPrizeDistribution","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x01A1F0699356afeB850f5A80226C35A9319CAf74","version":{"major":1,"minor":6,"patch":1},"type":"PrizeDistributionFactory","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeTierHistory","name":"_prizeTierHistory","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_minPickCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"calculatePrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint64","name":"_drawTimestamp","type":"uint64"}],"name":"calculatePrizeDistributionWithDrawData","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPickCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeTierHistory","outputs":[{"internalType":"contract IPrizeTierHistory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"pushPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"setPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x722e9BFC008358aC2d445a8d892cF7b62B550F3F","version":{"major":1,"minor":6,"patch":1},"type":"PrizeDistributor","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IDrawCalculator","name":"_drawCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"ClaimedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"calculator","type":"address"}],"name":"DrawCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TokenSet","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getDrawPayoutBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawCalculator","name":"_newCalculator","type":"address"}],"name":"setDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x4c65F496B78b7E81c15723f56a43925E5dc3a0e1","version":{"major":1,"minor":6,"patch":1},"type":"PrizeFlush","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":true,"internalType":"contract IReserve","name":"reserve","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"DestinationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Flushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IReserve","name":"reserve","type":"address"}],"name":"ReserveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"StrategySet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_destination","type":"address"}],"name":"setDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"name":"setReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStrategy","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x8d7355075B85B2aDD775E02ec581E0Da66326E49","version":{"major":1,"minor":6,"patch":1},"type":"PrizeSplitStrategy","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IPrizePool","name":"prizePool","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalPrizeCaptured","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeAwarded","type":"uint256"},{"indexed":true,"internalType":"contract IControlledToken","name":"token","type":"address"}],"name":"PrizeSplitAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"target","type":"uint256"}],"name":"PrizeSplitRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint16","name":"percentage","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"PrizeSplitSet","type":"event"},{"inputs":[],"name":"ONE_AS_FIXED_POINT_3","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPrizePool","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizeSplitIndex","type":"uint256"}],"name":"getPrizeSplit","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeSplits","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"_prizeSplit","type":"tuple"},{"internalType":"uint8","name":"_prizeSplitIndex","type":"uint8"}],"name":"setPrizeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"_newPrizeSplits","type":"tuple[]"}],"name":"setPrizeSplits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0xC88f04D5D00367Ecd016228302a1eACFaB164DBA","version":{"major":1,"minor":6,"patch":1},"type":"PrizeTierHistory","abi":[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getPrizeTier","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPrizeTierAtIndex","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeTierList","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"popAndPush","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"nextPrizeTier","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"replace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0xdd96e37D6DD515A5E7325503fb3958192F98e49F","version":{"major":1,"minor":6,"patch":1},"type":"ReceiverTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedPushedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x574834c934B3784aa8430A5B45724aAa2FcF2c7f","version":{"major":1,"minor":6,"patch":1},"type":"Reserve","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserveAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAccumulated","type":"uint256"}],"name":"Checkpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"getReserveAccumulatedBetween","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAccumulator","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x469C6F4c1AdA45EB2E251685aC2bf05aEd591E70","version":{"major":1,"minor":6,"patch":1},"type":"TWABDelegator","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegateeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"contract Delegation","name":"delegation","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegationCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFundedFromStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"RepresentativeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDelegation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WithdrewDelegationToStake","type":"event"},{"inputs":[],"name":"MAX_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"computeDelegationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"createDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationInstance","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegationFromStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"getDelegation","outputs":[{"internalType":"contract Delegation","name":"delegation","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"},{"internalType":"bool","name":"wasCreated","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"address","name":"_representative","type":"address"}],"name":"isRepresentativeOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitAndMulticall.Signature","name":"_permitSignature","type":"tuple"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"permitAndMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_representative","type":"address"},{"internalType":"bool","name":"_set","type":"bool"}],"name":"setRepresentative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferDelegationTo","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"updateDelegatee","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawDelegationToStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x62BB4fc73094c83B5e952C2180B23fA7054954c4","version":{"major":1,"minor":6,"patch":1},"type":"Ticket","abi":[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegate","type":"address"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTotalSupplyTwab","type":"tuple"}],"name":"NewTotalSupplyTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTwab","type":"tuple"}],"name":"NewUserTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"TicketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"controllerDelegateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"delegateOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_newDelegate","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"delegateWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAccountDetails","outputs":[{"components":[{"internalType":"uint208","name":"balance","type":"uint208"},{"internalType":"uint24","name":"nextTwabIndex","type":"uint24"},{"internalType":"uint24","name":"cardinality","type":"uint24"}],"internalType":"struct TwabLib.AccountDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_startTime","type":"uint64"},{"internalType":"uint64","name":"_endTime","type":"uint64"}],"name":"getAverageBalanceBetween","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageBalancesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageTotalSuppliesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getBalanceAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getBalancesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getTotalSuppliesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getTotalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"getTwab","outputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct ObservationLib.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x1470c87e2db5247A36C60DE3D65D7C972C62EA0f","version":{"major":1,"minor":6,"patch":1},"type":"TwabRewards","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"}],"name":"PromotionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PromotionDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"epochNumber","type":"uint8"}],"name":"PromotionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"PromotionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint8[]","name":"epochIds","type":"uint8[]"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint256","name":"_tokensPerEpoch","type":"uint256"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"createPromotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"destroyPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"endPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"extendPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getCurrentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getPromotion","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint8","name":"numberOfEpochs","type":"uint8"},{"internalType":"uint48","name":"epochDuration","type":"uint48"},{"internalType":"uint48","name":"createdAt","type":"uint48"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokensPerEpoch","type":"uint256"},{"internalType":"uint256","name":"rewardsUnclaimed","type":"uint256"}],"internalType":"struct ITwabRewards.Promotion","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getRemainingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"getRewardsAmount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x79Bc8bD53244bC8a9C8c27509a2d573650A83373","version":{"major":1,"minor":6,"patch":1},"type":"YieldSourcePrizePool","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IYieldSource","name":"_yieldSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Awarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardedExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balanceCap","type":"uint256"}],"name":"BalanceCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"}],"name":"ControlledTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"yieldSource","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"liquidityCap","type":"uint256"}],"name":"LiquidityCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prizeStrategy","type":"address"}],"name":"PrizeStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferredExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemed","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"award","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"awardExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"awardExternalERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_externalToken","type":"address"}],"name":"canAwardExternal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureAwardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICompLike","name":"_compLike","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"compLikeDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_delegate","type":"address"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccountedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_controlledToken","type":"address"}],"name":"isControlled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balanceCap","type":"uint256"}],"name":"setBalanceCap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityCap","type":"uint256"}],"name":"setLiquidityCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prizeStrategy","type":"address"}],"name":"setPrizeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"name":"setTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldSource","outputs":[{"internalType":"contract IYieldSource","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}}]} \ No newline at end of file +{"name":"PoolTogether V4 Mainnet","version":{"major":1,"minor":7,"patch":0},"tags":{},"contracts":[{"chainId":1,"address":"0x32e8D4c9d1B711BC958d0Ce8D14b41F77Bb03a64","version":{"major":1,"minor":7,"patch":0},"type":"ATokenYieldSource","abi":[{"inputs":[{"internalType":"contract ATokenInterface","name":"_aToken","type":"address"},{"internalType":"contract IAaveIncentivesController","name":"_incentivesController","type":"address"},{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"_lendingPoolAddressesProviderRegistry","type":"address"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAToken","name":"aToken","type":"address"},{"indexed":false,"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"lendingPoolAddressesProviderRegistry","type":"address"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"ATokenYieldSourceInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sponsored","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SuppliedTokenTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TransferredERC20","type":"event"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract ATokenInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approveMaxAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"claimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incentivesController","outputs":[{"internalType":"contract IAaveIncentivesController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lendingPoolAddressesProviderRegistry","outputs":[{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sponsor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"supplyTokenTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x6C04Eeeed2dEFedbC9A0f3f63bf14F39a189F607","version":{"major":1,"minor":7,"patch":0},"type":"BeaconTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x0D33612870cd9A475bBBbB7CC38fC66680dEcAC5","version":{"major":1,"minor":7,"patch":0},"type":"DrawBeacon","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract RNGInterface","name":"_rng","type":"address"},{"internalType":"uint32","name":"_nextDrawId","type":"uint32"},{"internalType":"uint64","name":"_beaconPeriodStart","type":"uint64"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint32","name":"_rngTimeout","type":"uint32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"drawPeriodSeconds","type":"uint32"}],"name":"BeaconPeriodSecondsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"startedAt","type":"uint64"}],"name":"BeaconPeriodStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"nextDrawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"newDrawBuffer","type":"address"}],"name":"DrawBufferUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"rngRequestId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"rngLockBlock","type":"uint32"}],"name":"DrawCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"DrawCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"rngRequestId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"rngLockBlock","type":"uint32"}],"name":"DrawStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract RNGInterface","name":"rngService","type":"address"}],"name":"RngServiceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"rngTimeout","type":"uint32"}],"name":"RngTimeoutSet","type":"event"},{"inputs":[],"name":"beaconPeriodEndAt","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beaconPeriodRemainingSeconds","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_time","type":"uint64"}],"name":"calculateNextBeaconPeriodStartTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculateNextBeaconPeriodStartTimeFromCurrentTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canCompleteDraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canStartDraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"completeDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBeaconPeriodSeconds","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBeaconPeriodStartedAt","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRngLockBlock","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRngRequestId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRngService","outputs":[{"internalType":"contract RNGInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRngTimeout","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isBeaconPeriodOver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngCompleted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngRequested","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngTimedOut","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"}],"name":"setBeaconPeriodSeconds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawBuffer","name":"newDrawBuffer","type":"address"}],"name":"setDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract RNGInterface","name":"_rngService","type":"address"}],"name":"setRngService","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_rngTimeout","type":"uint32"}],"name":"setRngTimeout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x78Ea5a9595279DC2F9608283875571b1151F19D4","version":{"major":1,"minor":7,"patch":0},"type":"DrawBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"}],"name":"DrawSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_CARDINALITY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getDraws","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"}],"name":"pushDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_newDraw","type":"tuple"}],"name":"setDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x14d0675580C7255043a3AeD3726F5D7f33292730","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculator","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract PrizeDistributor","name":"prizeDistributor","type":"address"}],"name":"PrizeDistributorSet","type":"event"},{"inputs":[],"name":"TIERS_LENGTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_pickIndicesForDraws","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getNormalizedBalancesForDrawIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x1DcaD946D10343cc4494D610d6273153FB071772","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculatorTimelock","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawCalculator","name":"_calculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"drawCalculator","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"LockedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"indexed":false,"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"timelock","type":"tuple"}],"name":"TimelockSet","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint32[]","name":"drawIds","type":"uint32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimelock","outputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasElapsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint64","name":"_timestamp","type":"uint64"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"_timelock","type":"tuple"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xdC90a79fcb1DBAd5F05E6C264F84AC4b0d351F94","version":{"major":1,"minor":7,"patch":0},"type":"L1TimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionPushed","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xf025a8d9E6080F885e841C8cC0E324368D7C6577","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"cardinality","type":"uint8"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeDistributions","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"pushPrizeDistribution","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"setPrizeDistribution","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x35A0dF72E1ea94B52F9EbE0D515928eCb663f39F","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionFactory","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeTierHistory","name":"_prizeTierHistory","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_minPickCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"calculatePrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint64","name":"_drawTimestamp","type":"uint64"}],"name":"calculatePrizeDistributionWithDrawData","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPickCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeTierHistory","outputs":[{"internalType":"contract IPrizeTierHistory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"pushPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"setPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xb9a179DcA5a7bf5f8B9E088437B3A85ebB495eFe","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributor","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IDrawCalculator","name":"_drawCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"ClaimedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"calculator","type":"address"}],"name":"DrawCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TokenSet","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getDrawPayoutBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawCalculator","name":"_newCalculator","type":"address"}],"name":"setDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x2193b28b2BdfBf805506C9D91Ed2021bA6fBc888","version":{"major":1,"minor":7,"patch":0},"type":"PrizeFlush","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":true,"internalType":"contract IReserve","name":"reserve","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"DestinationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Flushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IReserve","name":"reserve","type":"address"}],"name":"ReserveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"StrategySet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_destination","type":"address"}],"name":"setDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"name":"setReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStrategy","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x47a5ABfAcDebf5af312B034B3b748935A0259136","version":{"major":1,"minor":7,"patch":0},"type":"PrizeSplitStrategy","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IPrizePool","name":"prizePool","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalPrizeCaptured","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeAwarded","type":"uint256"},{"indexed":true,"internalType":"contract IControlledToken","name":"token","type":"address"}],"name":"PrizeSplitAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"target","type":"uint256"}],"name":"PrizeSplitRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint16","name":"percentage","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"PrizeSplitSet","type":"event"},{"inputs":[],"name":"ONE_AS_FIXED_POINT_3","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPrizePool","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizeSplitIndex","type":"uint256"}],"name":"getPrizeSplit","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeSplits","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"_prizeSplit","type":"tuple"},{"internalType":"uint8","name":"_prizeSplitIndex","type":"uint8"}],"name":"setPrizeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"_newPrizeSplits","type":"tuple[]"}],"name":"setPrizeSplits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x24C3e15BdC10Ce2CB1BEc56cd43F397cE9B89430","version":{"major":1,"minor":7,"patch":0},"type":"PrizeTierHistory","abi":[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getPrizeTier","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPrizeTierAtIndex","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeTierList","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"popAndPush","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"nextPrizeTier","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"replace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x3A06B40C67515cda47E44b57116488F73A441F72","version":{"major":1,"minor":7,"patch":0},"type":"RNGChainlinkV2","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract VRFCoordinatorV2Interface","name":"_vrfCoordinator","type":"address"},{"internalType":"uint64","name":"_subscriptionId","type":"uint64"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"keyHash","type":"bytes32"}],"name":"KeyHashSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"requestId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"RandomNumberCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"requestId","type":"uint32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RandomNumberRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"subscriptionId","type":"uint64"}],"name":"SubscriptionIdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract VRFCoordinatorV2Interface","name":"vrfCoordinator","type":"address"}],"name":"VrfCoordinatorSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getKeyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRequestId","outputs":[{"internalType":"uint32","name":"requestId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRequestFee","outputs":[{"internalType":"address","name":"feeToken","type":"address"},{"internalType":"uint256","name":"requestFee","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getSubscriptionId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVrfCoordinator","outputs":[{"internalType":"contract VRFCoordinatorV2Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_internalRequestId","type":"uint32"}],"name":"isRequestComplete","outputs":[{"internalType":"bool","name":"isCompleted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_internalRequestId","type":"uint32"}],"name":"randomNumber","outputs":[{"internalType":"uint256","name":"randomNum","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestRandomNumber","outputs":[{"internalType":"uint32","name":"requestId","type":"uint32"},{"internalType":"uint32","name":"lockBlock","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"name":"setKeyhash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_subscriptionId","type":"uint64"}],"name":"setSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xadB4D93D84b18b5D82063aCf58b21587c92fdfb5","version":{"major":1,"minor":7,"patch":0},"type":"Reserve","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserveAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAccumulated","type":"uint256"}],"name":"Checkpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"getReserveAccumulatedBetween","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAccumulator","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x5cFbEE38362B9A60be276763753f64245EA990F7","version":{"major":1,"minor":7,"patch":0},"type":"TWABDelegator","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegateeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"contract Delegation","name":"delegation","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegationCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFundedFromStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"RepresentativeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDelegation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WithdrewDelegationToStake","type":"event"},{"inputs":[],"name":"MAX_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"computeDelegationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"createDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationInstance","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegationFromStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"getDelegation","outputs":[{"internalType":"contract Delegation","name":"delegation","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"},{"internalType":"bool","name":"wasCreated","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"address","name":"_representative","type":"address"}],"name":"isRepresentativeOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitAndMulticall.Signature","name":"_permitSignature","type":"tuple"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"permitAndMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_representative","type":"address"},{"internalType":"bool","name":"_set","type":"bool"}],"name":"setRepresentative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferDelegationTo","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"updateDelegatee","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawDelegationToStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xdd4d117723C257CEe402285D3aCF218E9A8236E1","version":{"major":1,"minor":7,"patch":0},"type":"Ticket","abi":[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegate","type":"address"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTotalSupplyTwab","type":"tuple"}],"name":"NewTotalSupplyTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTwab","type":"tuple"}],"name":"NewUserTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"TicketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"controllerDelegateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"delegateOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_newDelegate","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"delegateWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAccountDetails","outputs":[{"components":[{"internalType":"uint208","name":"balance","type":"uint208"},{"internalType":"uint24","name":"nextTwabIndex","type":"uint24"},{"internalType":"uint24","name":"cardinality","type":"uint24"}],"internalType":"struct TwabLib.AccountDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_startTime","type":"uint64"},{"internalType":"uint64","name":"_endTime","type":"uint64"}],"name":"getAverageBalanceBetween","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageBalancesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageTotalSuppliesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getBalanceAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getBalancesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getTotalSuppliesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getTotalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"getTwab","outputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct ObservationLib.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xe7934EE0c8b877269A5688ee26dd853785212618","version":{"major":1,"minor":7,"patch":0},"type":"TwabRewards","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"}],"name":"PromotionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PromotionDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"epochNumber","type":"uint8"}],"name":"PromotionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"PromotionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint8[]","name":"epochIds","type":"uint8[]"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint256","name":"_tokensPerEpoch","type":"uint256"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"createPromotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"destroyPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"endPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"extendPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getCurrentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getPromotion","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint8","name":"numberOfEpochs","type":"uint8"},{"internalType":"uint48","name":"epochDuration","type":"uint48"},{"internalType":"uint48","name":"createdAt","type":"uint48"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokensPerEpoch","type":"uint256"},{"internalType":"uint256","name":"rewardsUnclaimed","type":"uint256"}],"internalType":"struct ITwabRewards.Promotion","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getRemainingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"getRewardsAmount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xd89a09084555a7D0ABe7B111b1f78DFEdDd638Be","version":{"major":1,"minor":7,"patch":0},"type":"YieldSourcePrizePool","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IYieldSource","name":"_yieldSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Awarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardedExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balanceCap","type":"uint256"}],"name":"BalanceCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"}],"name":"ControlledTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"yieldSource","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"liquidityCap","type":"uint256"}],"name":"LiquidityCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prizeStrategy","type":"address"}],"name":"PrizeStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferredExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemed","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"award","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"awardExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"awardExternalERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_externalToken","type":"address"}],"name":"canAwardExternal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureAwardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICompLike","name":"_compLike","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"compLikeDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_delegate","type":"address"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccountedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_controlledToken","type":"address"}],"name":"isControlled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balanceCap","type":"uint256"}],"name":"setBalanceCap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityCap","type":"uint256"}],"name":"setLiquidityCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prizeStrategy","type":"address"}],"name":"setPrizeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"name":"setTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldSource","outputs":[{"internalType":"contract IYieldSource","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xD4F6d570133401079D213EcF4A14FA0B4bfB5b9C","version":{"major":1,"minor":7,"patch":0},"type":"ATokenYieldSource","abi":[{"inputs":[{"internalType":"contract ATokenInterface","name":"_aToken","type":"address"},{"internalType":"contract IAaveIncentivesController","name":"_incentivesController","type":"address"},{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"_lendingPoolAddressesProviderRegistry","type":"address"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAToken","name":"aToken","type":"address"},{"indexed":false,"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"lendingPoolAddressesProviderRegistry","type":"address"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"ATokenYieldSourceInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sponsored","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SuppliedTokenTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TransferredERC20","type":"event"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract ATokenInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approveMaxAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"claimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incentivesController","outputs":[{"internalType":"contract IAaveIncentivesController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lendingPoolAddressesProviderRegistry","outputs":[{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sponsor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"supplyTokenTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x94f23320ac3Ed351782791506266351eb4183e8d","version":{"major":1,"minor":7,"patch":0},"type":"BeaconTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x52325504bD35aeC31D842F62A113E9e4b665d885","version":{"major":1,"minor":7,"patch":0},"type":"DrawBeacon","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract RNGInterface","name":"_rng","type":"address"},{"internalType":"uint32","name":"_nextDrawId","type":"uint32"},{"internalType":"uint64","name":"_beaconPeriodStart","type":"uint64"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint32","name":"_rngTimeout","type":"uint32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"drawPeriodSeconds","type":"uint32"}],"name":"BeaconPeriodSecondsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"startedAt","type":"uint64"}],"name":"BeaconPeriodStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"nextDrawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"newDrawBuffer","type":"address"}],"name":"DrawBufferUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"rngRequestId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"rngLockBlock","type":"uint32"}],"name":"DrawCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"DrawCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"rngRequestId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"rngLockBlock","type":"uint32"}],"name":"DrawStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract RNGInterface","name":"rngService","type":"address"}],"name":"RngServiceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"rngTimeout","type":"uint32"}],"name":"RngTimeoutSet","type":"event"},{"inputs":[],"name":"beaconPeriodEndAt","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beaconPeriodRemainingSeconds","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_time","type":"uint64"}],"name":"calculateNextBeaconPeriodStartTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculateNextBeaconPeriodStartTimeFromCurrentTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canCompleteDraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canStartDraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"completeDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBeaconPeriodSeconds","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBeaconPeriodStartedAt","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRngLockBlock","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRngRequestId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRngService","outputs":[{"internalType":"contract RNGInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRngTimeout","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isBeaconPeriodOver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngCompleted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngRequested","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngTimedOut","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"}],"name":"setBeaconPeriodSeconds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawBuffer","name":"newDrawBuffer","type":"address"}],"name":"setDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract RNGInterface","name":"_rngService","type":"address"}],"name":"setRngService","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_rngTimeout","type":"uint32"}],"name":"setRngTimeout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x44B1d66E7B9d4467139924f31754F34cbC392f44","version":{"major":1,"minor":7,"patch":0},"type":"DrawBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"}],"name":"DrawSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_CARDINALITY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getDraws","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"}],"name":"pushDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_newDraw","type":"tuple"}],"name":"setDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x3976BD6F4B82C97314570A77bc1e979f7A839A24","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculator","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract PrizeDistributor","name":"prizeDistributor","type":"address"}],"name":"PrizeDistributorSet","type":"event"},{"inputs":[],"name":"TIERS_LENGTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_pickIndicesForDraws","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getNormalizedBalancesForDrawIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x0C22044B0aA634e26C5B5e50E2B958C7aF59c161","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculatorTimelock","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawCalculator","name":"_calculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"drawCalculator","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"LockedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"indexed":false,"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"timelock","type":"tuple"}],"name":"TimelockSet","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint32[]","name":"drawIds","type":"uint32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimelock","outputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasElapsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint64","name":"_timestamp","type":"uint64"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"_timelock","type":"tuple"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xc366bF1a054CA495c09B1A722D863ac65746138E","version":{"major":1,"minor":7,"patch":0},"type":"L2TimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"DrawAndPrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xcf6030BDEaB4E503D186426510aD88C1DA7125A3","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"cardinality","type":"uint8"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeDistributions","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"pushPrizeDistribution","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"setPrizeDistribution","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x38004713B1793f00c5B497E3eCC1a50697e5FfaE","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionFactory","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeTierHistory","name":"_prizeTierHistory","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_minPickCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"calculatePrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint64","name":"_drawTimestamp","type":"uint64"}],"name":"calculatePrizeDistributionWithDrawData","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPickCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeTierHistory","outputs":[{"internalType":"contract IPrizeTierHistory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"pushPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"setPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x8141BcFBcEE654c5dE17C4e2B2AF26B67f9B9056","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributor","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IDrawCalculator","name":"_drawCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"ClaimedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"calculator","type":"address"}],"name":"DrawCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TokenSet","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getDrawPayoutBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawCalculator","name":"_newCalculator","type":"address"}],"name":"setDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xA2342489470474536F04cd4DdA2e8658303b305d","version":{"major":1,"minor":7,"patch":0},"type":"PrizeFlush","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":true,"internalType":"contract IReserve","name":"reserve","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"DestinationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Flushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IReserve","name":"reserve","type":"address"}],"name":"ReserveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"StrategySet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_destination","type":"address"}],"name":"setDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"name":"setReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStrategy","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x879e176Ae9Fe9B00c30f4827364eA9e4fB35858D","version":{"major":1,"minor":7,"patch":0},"type":"PrizeSplitStrategy","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IPrizePool","name":"prizePool","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalPrizeCaptured","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeAwarded","type":"uint256"},{"indexed":true,"internalType":"contract IControlledToken","name":"token","type":"address"}],"name":"PrizeSplitAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"target","type":"uint256"}],"name":"PrizeSplitRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint16","name":"percentage","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"PrizeSplitSet","type":"event"},{"inputs":[],"name":"ONE_AS_FIXED_POINT_3","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPrizePool","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizeSplitIndex","type":"uint256"}],"name":"getPrizeSplit","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeSplits","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"_prizeSplit","type":"tuple"},{"internalType":"uint8","name":"_prizeSplitIndex","type":"uint8"}],"name":"setPrizeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"_newPrizeSplits","type":"tuple[]"}],"name":"setPrizeSplits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x1DcaD946D10343cc4494D610d6273153FB071772","version":{"major":1,"minor":7,"patch":0},"type":"PrizeTierHistory","abi":[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getPrizeTier","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPrizeTierAtIndex","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeTierList","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"popAndPush","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"nextPrizeTier","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"replace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x7402d9f36904894273B31dD0d998D826c833EF93","version":{"major":1,"minor":7,"patch":0},"type":"RNGChainlinkV2","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract VRFCoordinatorV2Interface","name":"_vrfCoordinator","type":"address"},{"internalType":"uint64","name":"_subscriptionId","type":"uint64"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"keyHash","type":"bytes32"}],"name":"KeyHashSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"requestId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"RandomNumberCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"requestId","type":"uint32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RandomNumberRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"subscriptionId","type":"uint64"}],"name":"SubscriptionIdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract VRFCoordinatorV2Interface","name":"vrfCoordinator","type":"address"}],"name":"VrfCoordinatorSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getKeyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRequestId","outputs":[{"internalType":"uint32","name":"requestId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRequestFee","outputs":[{"internalType":"address","name":"feeToken","type":"address"},{"internalType":"uint256","name":"requestFee","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getSubscriptionId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVrfCoordinator","outputs":[{"internalType":"contract VRFCoordinatorV2Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_internalRequestId","type":"uint32"}],"name":"isRequestComplete","outputs":[{"internalType":"bool","name":"isCompleted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_internalRequestId","type":"uint32"}],"name":"randomNumber","outputs":[{"internalType":"uint256","name":"randomNum","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestRandomNumber","outputs":[{"internalType":"uint32","name":"requestId","type":"uint32"},{"internalType":"uint32","name":"lockBlock","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"name":"setKeyhash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_subscriptionId","type":"uint64"}],"name":"setSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x0F3137E09349449b62144f0918135dE548FdFeeE","version":{"major":1,"minor":7,"patch":0},"type":"ReceiverTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedPushedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xCE148f6acFee9FEFb42A736B4976e657f35982b8","version":{"major":1,"minor":7,"patch":0},"type":"Reserve","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserveAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAccumulated","type":"uint256"}],"name":"Checkpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"getReserveAccumulatedBetween","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAccumulator","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x89Ee77Ce3F4C1b0346FF96E3004ff7C9f972dEF8","version":{"major":1,"minor":7,"patch":0},"type":"TWABDelegator","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegateeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"contract Delegation","name":"delegation","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegationCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFundedFromStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"RepresentativeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDelegation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WithdrewDelegationToStake","type":"event"},{"inputs":[],"name":"MAX_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"computeDelegationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"createDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationInstance","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegationFromStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"getDelegation","outputs":[{"internalType":"contract Delegation","name":"delegation","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"},{"internalType":"bool","name":"wasCreated","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"address","name":"_representative","type":"address"}],"name":"isRepresentativeOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitAndMulticall.Signature","name":"_permitSignature","type":"tuple"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"permitAndMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_representative","type":"address"},{"internalType":"bool","name":"_set","type":"bool"}],"name":"setRepresentative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferDelegationTo","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"updateDelegatee","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawDelegationToStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x6a304dFdb9f808741244b6bfEe65ca7B3b3A6076","version":{"major":1,"minor":7,"patch":0},"type":"Ticket","abi":[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegate","type":"address"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTotalSupplyTwab","type":"tuple"}],"name":"NewTotalSupplyTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTwab","type":"tuple"}],"name":"NewUserTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"TicketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"controllerDelegateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"delegateOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_newDelegate","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"delegateWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAccountDetails","outputs":[{"components":[{"internalType":"uint208","name":"balance","type":"uint208"},{"internalType":"uint24","name":"nextTwabIndex","type":"uint24"},{"internalType":"uint24","name":"cardinality","type":"uint24"}],"internalType":"struct TwabLib.AccountDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_startTime","type":"uint64"},{"internalType":"uint64","name":"_endTime","type":"uint64"}],"name":"getAverageBalanceBetween","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageBalancesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageTotalSuppliesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getBalanceAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getBalancesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getTotalSuppliesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getTotalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"getTwab","outputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct ObservationLib.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x1470c87e2db5247A36C60DE3D65D7C972C62EA0f","version":{"major":1,"minor":7,"patch":0},"type":"TwabRewards","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"}],"name":"PromotionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PromotionDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"epochNumber","type":"uint8"}],"name":"PromotionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"PromotionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint8[]","name":"epochIds","type":"uint8[]"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint256","name":"_tokensPerEpoch","type":"uint256"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"createPromotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"destroyPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"endPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"extendPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getCurrentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getPromotion","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint8","name":"numberOfEpochs","type":"uint8"},{"internalType":"uint48","name":"epochDuration","type":"uint48"},{"internalType":"uint48","name":"createdAt","type":"uint48"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokensPerEpoch","type":"uint256"},{"internalType":"uint256","name":"rewardsUnclaimed","type":"uint256"}],"internalType":"struct ITwabRewards.Promotion","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getRemainingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"getRewardsAmount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x19DE635fb3678D8B8154E37d8C9Cdf182Fe84E60","version":{"major":1,"minor":7,"patch":0},"type":"YieldSourcePrizePool","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IYieldSource","name":"_yieldSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Awarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardedExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balanceCap","type":"uint256"}],"name":"BalanceCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"}],"name":"ControlledTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"yieldSource","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"liquidityCap","type":"uint256"}],"name":"LiquidityCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prizeStrategy","type":"address"}],"name":"PrizeStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferredExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemed","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"award","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"awardExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"awardExternalERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_externalToken","type":"address"}],"name":"canAwardExternal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureAwardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICompLike","name":"_compLike","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"compLikeDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_delegate","type":"address"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccountedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_controlledToken","type":"address"}],"name":"isControlled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balanceCap","type":"uint256"}],"name":"setBalanceCap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityCap","type":"uint256"}],"name":"setLiquidityCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prizeStrategy","type":"address"}],"name":"setPrizeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"name":"setTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldSource","outputs":[{"internalType":"contract IYieldSource","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x7437db21A0dEB844Fa64223e2d6Db569De9648Ff","version":{"major":1,"minor":7,"patch":0},"type":"ATokenYieldSource","abi":[{"inputs":[{"internalType":"contract ATokenInterface","name":"_aToken","type":"address"},{"internalType":"contract IAaveIncentivesController","name":"_incentivesController","type":"address"},{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"_lendingPoolAddressesProviderRegistry","type":"address"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAToken","name":"aToken","type":"address"},{"indexed":false,"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"lendingPoolAddressesProviderRegistry","type":"address"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"ATokenYieldSourceInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sponsored","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SuppliedTokenTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TransferredERC20","type":"event"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract ATokenInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approveMaxAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"claimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incentivesController","outputs":[{"internalType":"contract IAaveIncentivesController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lendingPoolAddressesProviderRegistry","outputs":[{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sponsor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"supplyTokenTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x31bCAF169D25f938A25c2e4C762f3D1D3FA7dB2E","version":{"major":1,"minor":7,"patch":0},"type":"DrawBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"}],"name":"DrawSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_CARDINALITY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getDraws","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"}],"name":"pushDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_newDraw","type":"tuple"}],"name":"setDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x0F5F5EF16465371152fC46C72D06fb0ec9392a47","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculator","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract PrizeDistributor","name":"prizeDistributor","type":"address"}],"name":"PrizeDistributorSet","type":"event"},{"inputs":[],"name":"TIERS_LENGTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_pickIndicesForDraws","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getNormalizedBalancesForDrawIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x01eE1Ea692773f28c45D63133426f21923C3c2Ba","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculatorTimelock","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawCalculator","name":"_calculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"drawCalculator","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"LockedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"indexed":false,"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"timelock","type":"tuple"}],"name":"TimelockSet","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint32[]","name":"drawIds","type":"uint32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimelock","outputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasElapsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint64","name":"_timestamp","type":"uint64"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"_timelock","type":"tuple"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xC660A8De5eB9E123E475Ae9A9f62dB62c92a3648","version":{"major":1,"minor":7,"patch":0},"type":"EIP2612PermitAndDeposit","abi":[{"inputs":[{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"components":[{"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"internalType":"struct DelegateSignature","name":"_delegateSignature","type":"tuple"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"_permitSignature","type":"tuple"},{"components":[{"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"internalType":"struct DelegateSignature","name":"_delegateSignature","type":"tuple"}],"name":"permitAndDepositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xC8faa39E06ddB8362cb8E3FFDAdeB5bF7877ECcb","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"cardinality","type":"uint8"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeDistributions","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"pushPrizeDistribution","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"setPrizeDistribution","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x87FCF371D68d2429D57Bf1BadcBEEc3463F0DD37","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionFactory","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeTierHistory","name":"_prizeTierHistory","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_minPickCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"calculatePrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint64","name":"_drawTimestamp","type":"uint64"}],"name":"calculatePrizeDistributionWithDrawData","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPickCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeTierHistory","outputs":[{"internalType":"contract IPrizeTierHistory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"pushPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"setPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x83332F908f403ce795D90f677cE3f382FE73f3D1","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributor","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IDrawCalculator","name":"_drawCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"ClaimedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"calculator","type":"address"}],"name":"DrawCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TokenSet","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getDrawPayoutBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawCalculator","name":"_newCalculator","type":"address"}],"name":"setDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x1B20994C3894EcC862e26A9F4EC626A8489DD051","version":{"major":1,"minor":7,"patch":0},"type":"PrizeFlush","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":true,"internalType":"contract IReserve","name":"reserve","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"DestinationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Flushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IReserve","name":"reserve","type":"address"}],"name":"ReserveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"StrategySet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_destination","type":"address"}],"name":"setDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"name":"setReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStrategy","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xA30cB2A488dc616F060a54Ee7971d0bD832547Ec","version":{"major":1,"minor":7,"patch":0},"type":"PrizeSplitStrategy","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IPrizePool","name":"prizePool","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalPrizeCaptured","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeAwarded","type":"uint256"},{"indexed":true,"internalType":"contract IControlledToken","name":"token","type":"address"}],"name":"PrizeSplitAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"target","type":"uint256"}],"name":"PrizeSplitRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint16","name":"percentage","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"PrizeSplitSet","type":"event"},{"inputs":[],"name":"ONE_AS_FIXED_POINT_3","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPrizePool","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizeSplitIndex","type":"uint256"}],"name":"getPrizeSplit","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeSplits","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"_prizeSplit","type":"tuple"},{"internalType":"uint8","name":"_prizeSplitIndex","type":"uint8"}],"name":"setPrizeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"_newPrizeSplits","type":"tuple[]"}],"name":"setPrizeSplits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xC3DAD539E460103c860Bb9Ca547647EDbD4903b6","version":{"major":1,"minor":7,"patch":0},"type":"PrizeTierHistory","abi":[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getPrizeTier","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPrizeTierAtIndex","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeTierList","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"popAndPush","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"nextPrizeTier","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"replace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x832cB306640dD33542dBa08ca1c13DD6686A3a88","version":{"major":1,"minor":7,"patch":0},"type":"ReceiverTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedPushedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xf04E5B81e69Cdc3c08BC5Da64ca053AD46a3d029","version":{"major":1,"minor":7,"patch":0},"type":"Reserve","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserveAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAccumulated","type":"uint256"}],"name":"Checkpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"getReserveAccumulatedBetween","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAccumulator","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xd23723fef8A16B77eaDc1fC822aE4170bA9d4009","version":{"major":1,"minor":7,"patch":0},"type":"TWABDelegator","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegateeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"contract Delegation","name":"delegation","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegationCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFundedFromStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"RepresentativeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDelegation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WithdrewDelegationToStake","type":"event"},{"inputs":[],"name":"MAX_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"computeDelegationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"createDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationInstance","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegationFromStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"getDelegation","outputs":[{"internalType":"contract Delegation","name":"delegation","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"},{"internalType":"bool","name":"wasCreated","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"address","name":"_representative","type":"address"}],"name":"isRepresentativeOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitAndMulticall.Signature","name":"_permitSignature","type":"tuple"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"permitAndMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_representative","type":"address"},{"internalType":"bool","name":"_set","type":"bool"}],"name":"setRepresentative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferDelegationTo","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"updateDelegatee","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawDelegationToStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xB27f379C050f6eD0973A01667458af6eCeBc1d90","version":{"major":1,"minor":7,"patch":0},"type":"Ticket","abi":[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegate","type":"address"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTotalSupplyTwab","type":"tuple"}],"name":"NewTotalSupplyTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTwab","type":"tuple"}],"name":"NewUserTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"TicketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"controllerDelegateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"delegateOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_newDelegate","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"delegateWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAccountDetails","outputs":[{"components":[{"internalType":"uint208","name":"balance","type":"uint208"},{"internalType":"uint24","name":"nextTwabIndex","type":"uint24"},{"internalType":"uint24","name":"cardinality","type":"uint24"}],"internalType":"struct TwabLib.AccountDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_startTime","type":"uint64"},{"internalType":"uint64","name":"_endTime","type":"uint64"}],"name":"getAverageBalanceBetween","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageBalancesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageTotalSuppliesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getBalanceAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getBalancesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getTotalSuppliesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getTotalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"getTwab","outputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct ObservationLib.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x01A1F0699356afeB850f5A80226C35A9319CAf74","version":{"major":1,"minor":7,"patch":0},"type":"TwabRewards","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"}],"name":"PromotionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PromotionDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"epochNumber","type":"uint8"}],"name":"PromotionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"PromotionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint8[]","name":"epochIds","type":"uint8[]"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint256","name":"_tokensPerEpoch","type":"uint256"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"createPromotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"destroyPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"endPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"extendPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getCurrentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getPromotion","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint8","name":"numberOfEpochs","type":"uint8"},{"internalType":"uint48","name":"epochDuration","type":"uint48"},{"internalType":"uint48","name":"createdAt","type":"uint48"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokensPerEpoch","type":"uint256"},{"internalType":"uint256","name":"rewardsUnclaimed","type":"uint256"}],"internalType":"struct ITwabRewards.Promotion","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getRemainingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"getRewardsAmount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xF830F5Cb2422d555EC34178E27094a816c8F95EC","version":{"major":1,"minor":7,"patch":0},"type":"YieldSourcePrizePool","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IYieldSource","name":"_yieldSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Awarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardedExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balanceCap","type":"uint256"}],"name":"BalanceCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"}],"name":"ControlledTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"yieldSource","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"liquidityCap","type":"uint256"}],"name":"LiquidityCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prizeStrategy","type":"address"}],"name":"PrizeStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferredExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemed","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"award","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"awardExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"awardExternalERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_externalToken","type":"address"}],"name":"canAwardExternal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureAwardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICompLike","name":"_compLike","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"compLikeDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_delegate","type":"address"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccountedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_controlledToken","type":"address"}],"name":"isControlled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balanceCap","type":"uint256"}],"name":"setBalanceCap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityCap","type":"uint256"}],"name":"setLiquidityCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prizeStrategy","type":"address"}],"name":"setPrizeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"name":"setTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldSource","outputs":[{"internalType":"contract IYieldSource","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x4ecB5300D9ec6BCA09d66bfd8Dcb532e3192dDA1","version":{"major":1,"minor":7,"patch":0},"type":"AaveV3YieldSource","abi":[{"inputs":[{"internalType":"contract IAToken","name":"_aToken","type":"address"},{"internalType":"contract IRewardsController","name":"_rewardsController","type":"address"},{"internalType":"contract IPoolAddressesProviderRegistry","name":"_poolAddressesProviderRegistry","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAToken","name":"aToken","type":"address"},{"indexed":false,"internalType":"contract IRewardsController","name":"rewardsController","type":"address"},{"indexed":false,"internalType":"contract IPoolAddressesProviderRegistry","name":"poolAddressesProviderRegistry","type":"address"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"AaveV3YieldSourceInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address[]","name":"rewardsList","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"claimedAmounts","type":"uint256[]"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"DecreasedERC20Allowance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"IncreasedERC20Allowance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SuppliedTokenTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TransferredERC20","type":"event"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract IAToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"decreaseERC20Allowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"increaseERC20Allowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolAddressesProviderRegistry","outputs":[{"internalType":"contract IPoolAddressesProviderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_redeemAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsController","outputs":[{"internalType":"contract IRewardsController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_depositAmount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"supplyTokenTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x267DD4034830Bb4ba9314e0471C1dDFD79849777","version":{"major":1,"minor":7,"patch":0},"type":"DrawBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"}],"name":"DrawSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_CARDINALITY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getDraws","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"}],"name":"pushDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_newDraw","type":"tuple"}],"name":"setDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x46d2f8e4D8Ff3d76cf252D89dD9b422f04123D2c","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculator","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract PrizeDistributor","name":"prizeDistributor","type":"address"}],"name":"PrizeDistributorSet","type":"event"},{"inputs":[],"name":"TIERS_LENGTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_pickIndicesForDraws","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getNormalizedBalancesForDrawIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0xd23723fef8A16B77eaDc1fC822aE4170bA9d4009","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculatorTimelock","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawCalculator","name":"_calculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"drawCalculator","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"LockedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"indexed":false,"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"timelock","type":"tuple"}],"name":"TimelockSet","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint32[]","name":"drawIds","type":"uint32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimelock","outputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasElapsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint64","name":"_timestamp","type":"uint64"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"_timelock","type":"tuple"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0xcddfa3BfC0e548d9A526E3355FefDf987F4e1aAE","version":{"major":1,"minor":7,"patch":0},"type":"EIP2612PermitAndDeposit","abi":[{"inputs":[{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"components":[{"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"internalType":"struct DelegateSignature","name":"_delegateSignature","type":"tuple"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"_permitSignature","type":"tuple"},{"components":[{"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"internalType":"struct DelegateSignature","name":"_delegateSignature","type":"tuple"}],"name":"permitAndDepositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x8e4F3098192948E342fB11ED7C4a23CD5A306973","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"cardinality","type":"uint8"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeDistributions","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"pushPrizeDistribution","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"setPrizeDistribution","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x01A1F0699356afeB850f5A80226C35A9319CAf74","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionFactory","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeTierHistory","name":"_prizeTierHistory","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_minPickCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"calculatePrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint64","name":"_drawTimestamp","type":"uint64"}],"name":"calculatePrizeDistributionWithDrawData","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPickCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeTierHistory","outputs":[{"internalType":"contract IPrizeTierHistory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"pushPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"setPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x722e9BFC008358aC2d445a8d892cF7b62B550F3F","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributor","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IDrawCalculator","name":"_drawCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"ClaimedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"calculator","type":"address"}],"name":"DrawCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TokenSet","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getDrawPayoutBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawCalculator","name":"_newCalculator","type":"address"}],"name":"setDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x4c65F496B78b7E81c15723f56a43925E5dc3a0e1","version":{"major":1,"minor":7,"patch":0},"type":"PrizeFlush","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":true,"internalType":"contract IReserve","name":"reserve","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"DestinationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Flushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IReserve","name":"reserve","type":"address"}],"name":"ReserveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"StrategySet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_destination","type":"address"}],"name":"setDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"name":"setReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStrategy","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x8d7355075B85B2aDD775E02ec581E0Da66326E49","version":{"major":1,"minor":7,"patch":0},"type":"PrizeSplitStrategy","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IPrizePool","name":"prizePool","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalPrizeCaptured","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeAwarded","type":"uint256"},{"indexed":true,"internalType":"contract IControlledToken","name":"token","type":"address"}],"name":"PrizeSplitAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"target","type":"uint256"}],"name":"PrizeSplitRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint16","name":"percentage","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"PrizeSplitSet","type":"event"},{"inputs":[],"name":"ONE_AS_FIXED_POINT_3","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPrizePool","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizeSplitIndex","type":"uint256"}],"name":"getPrizeSplit","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeSplits","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"_prizeSplit","type":"tuple"},{"internalType":"uint8","name":"_prizeSplitIndex","type":"uint8"}],"name":"setPrizeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"_newPrizeSplits","type":"tuple[]"}],"name":"setPrizeSplits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0xC88f04D5D00367Ecd016228302a1eACFaB164DBA","version":{"major":1,"minor":7,"patch":0},"type":"PrizeTierHistory","abi":[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getPrizeTier","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPrizeTierAtIndex","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeTierList","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"popAndPush","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"nextPrizeTier","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"replace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0xdd96e37D6DD515A5E7325503fb3958192F98e49F","version":{"major":1,"minor":7,"patch":0},"type":"ReceiverTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedPushedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x574834c934B3784aa8430A5B45724aAa2FcF2c7f","version":{"major":1,"minor":7,"patch":0},"type":"Reserve","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserveAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAccumulated","type":"uint256"}],"name":"Checkpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"getReserveAccumulatedBetween","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAccumulator","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x469C6F4c1AdA45EB2E251685aC2bf05aEd591E70","version":{"major":1,"minor":7,"patch":0},"type":"TWABDelegator","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegateeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"contract Delegation","name":"delegation","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegationCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFundedFromStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"RepresentativeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDelegation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WithdrewDelegationToStake","type":"event"},{"inputs":[],"name":"MAX_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"computeDelegationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"createDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationInstance","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegationFromStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"getDelegation","outputs":[{"internalType":"contract Delegation","name":"delegation","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"},{"internalType":"bool","name":"wasCreated","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"address","name":"_representative","type":"address"}],"name":"isRepresentativeOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitAndMulticall.Signature","name":"_permitSignature","type":"tuple"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"permitAndMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_representative","type":"address"},{"internalType":"bool","name":"_set","type":"bool"}],"name":"setRepresentative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferDelegationTo","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"updateDelegatee","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawDelegationToStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x62BB4fc73094c83B5e952C2180B23fA7054954c4","version":{"major":1,"minor":7,"patch":0},"type":"Ticket","abi":[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegate","type":"address"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTotalSupplyTwab","type":"tuple"}],"name":"NewTotalSupplyTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTwab","type":"tuple"}],"name":"NewUserTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"TicketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"controllerDelegateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"delegateOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_newDelegate","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"delegateWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAccountDetails","outputs":[{"components":[{"internalType":"uint208","name":"balance","type":"uint208"},{"internalType":"uint24","name":"nextTwabIndex","type":"uint24"},{"internalType":"uint24","name":"cardinality","type":"uint24"}],"internalType":"struct TwabLib.AccountDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_startTime","type":"uint64"},{"internalType":"uint64","name":"_endTime","type":"uint64"}],"name":"getAverageBalanceBetween","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageBalancesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageTotalSuppliesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getBalanceAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getBalancesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getTotalSuppliesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getTotalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"getTwab","outputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct ObservationLib.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x1470c87e2db5247A36C60DE3D65D7C972C62EA0f","version":{"major":1,"minor":7,"patch":0},"type":"TwabRewards","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"}],"name":"PromotionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PromotionDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"epochNumber","type":"uint8"}],"name":"PromotionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"PromotionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint8[]","name":"epochIds","type":"uint8[]"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint256","name":"_tokensPerEpoch","type":"uint256"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"createPromotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"destroyPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"endPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"extendPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getCurrentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getPromotion","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint8","name":"numberOfEpochs","type":"uint8"},{"internalType":"uint48","name":"epochDuration","type":"uint48"},{"internalType":"uint48","name":"createdAt","type":"uint48"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokensPerEpoch","type":"uint256"},{"internalType":"uint256","name":"rewardsUnclaimed","type":"uint256"}],"internalType":"struct ITwabRewards.Promotion","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getRemainingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"getRewardsAmount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x79Bc8bD53244bC8a9C8c27509a2d573650A83373","version":{"major":1,"minor":7,"patch":0},"type":"YieldSourcePrizePool","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IYieldSource","name":"_yieldSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Awarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardedExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balanceCap","type":"uint256"}],"name":"BalanceCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"}],"name":"ControlledTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"yieldSource","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"liquidityCap","type":"uint256"}],"name":"LiquidityCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prizeStrategy","type":"address"}],"name":"PrizeStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferredExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemed","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"award","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"awardExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"awardExternalERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_externalToken","type":"address"}],"name":"canAwardExternal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureAwardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICompLike","name":"_compLike","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"compLikeDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_delegate","type":"address"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccountedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_controlledToken","type":"address"}],"name":"isControlled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balanceCap","type":"uint256"}],"name":"setBalanceCap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityCap","type":"uint256"}],"name":"setLiquidityCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prizeStrategy","type":"address"}],"name":"setPrizeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"name":"setTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldSource","outputs":[{"internalType":"contract IYieldSource","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}}]} \ No newline at end of file diff --git a/deploy/v1.7.0/polygon.ts b/deploy/v1.7.0/polygon.ts new file mode 100644 index 0000000..8992c46 --- /dev/null +++ b/deploy/v1.7.0/polygon.ts @@ -0,0 +1,71 @@ +import { dim } from 'chalk'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; + +import { + BEACON_PERIOD_SECONDS, + RNG_TIMEOUT_SECONDS, +} from '../../src/constants'; +import { deployAndLog } from '../../src/deployAndLog'; +import { setManager } from '../../src/setManager'; +import { transferOwnership } from '../../src/transferOwnership'; + +export default async function deployToEthereumMainnet(hardhat: HardhatRuntimeEnvironment){ + if (process.env.DEPLOY === 'v1.7.0.polygon') { + dim(`Deploying: DrawBeacon, RNGChainlinkV2, BeaconTimelockTrigger on Polygon`) + dim(`Version: 1.7.0`) + } else { return } + + const { getNamedAccounts, ethers } = hardhat; + const { getContract } = ethers; + + const { deployer, defenderRelayer, executiveTeam } = await getNamedAccounts(); + + const drawBuffer = await getContract('DrawBuffer'); + const drawCalculatorTimelock = await getContract('DrawCalculatorTimelock') + const prizeDistributionFactory = await getContract('PrizeDistributionFactory'); + + // =================================================== + // Deploy Contracts + // =================================================== + + const rngServiceResult = await deployAndLog('RNGChainlinkV2', { + from: deployer, + args: [ + deployer, + '0xAE975071Be8F8eE67addBC1A82488F1C24858067', // VRF Coordinator address + 472, // Subscription id + '0xcc294a196eeeb44da2888d17c0625cc88d70d9760a69d58d853ba6581a9ab0cd', // 500 gwei key hash gas lane + ], + skipIfAlreadyDeployed: true, + }); + + const drawBeaconResult = await deployAndLog('DrawBeacon', { + from: deployer, + args: [ + deployer, + drawBuffer.address, + rngServiceResult.address, + 411, // Starting DrawID + 1669748400, // Nov 29, 2022, 7:00:00 PM UTC + BEACON_PERIOD_SECONDS, // 86400 = one day + RNG_TIMEOUT_SECONDS // 2 * 3600 = 2 hours + ], + skipIfAlreadyDeployed: true, + }); + + await deployAndLog('BeaconTimelockTrigger', { + from: deployer, + args: [ + deployer, + prizeDistributionFactory.address, + drawCalculatorTimelock.address + ] + }); + + await setManager('RNGChainlinkV2', null, drawBeaconResult.address); + await setManager('BeaconTimelockTrigger', null, defenderRelayer); + + await transferOwnership('RNGChainlinkV2', null, executiveTeam); + await transferOwnership('DrawBeacon', null, executiveTeam); + await transferOwnership('BeaconTimelockTrigger', null, executiveTeam); +} diff --git a/deployments/polygon/BeaconTimelockTrigger.json b/deployments/polygon/BeaconTimelockTrigger.json new file mode 100644 index 0000000..ae753b0 --- /dev/null +++ b/deployments/polygon/BeaconTimelockTrigger.json @@ -0,0 +1,509 @@ +{ + "address": "0x94f23320ac3Ed351782791506266351eb4183e8d", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "contract IPrizeDistributionFactory", + "name": "_prizeDistributionFactory", + "type": "address" + }, + { + "internalType": "contract IDrawCalculatorTimelock", + "name": "_timelock", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IPrizeDistributionFactory", + "name": "prizeDistributionFactory", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IDrawCalculatorTimelock", + "name": "timelock", + "type": "address" + } + ], + "name": "Deployed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "drawId", + "type": "uint32" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "winningRandomNumber", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "drawId", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "timestamp", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "beaconPeriodStartedAt", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "beaconPeriodSeconds", + "type": "uint32" + } + ], + "indexed": false, + "internalType": "struct IDrawBeacon.Draw", + "name": "draw", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalNetworkTicketSupply", + "type": "uint256" + } + ], + "name": "DrawLockedAndTotalNetworkTicketSupplyPushed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newManager", + "type": "address" + } + ], + "name": "ManagerTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "pendingOwner", + "type": "address" + } + ], + "name": "OwnershipOffered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "claimOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "prizeDistributionFactory", + "outputs": [ + { + "internalType": "contract IPrizeDistributionFactory", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "winningRandomNumber", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "drawId", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "timestamp", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "beaconPeriodStartedAt", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "beaconPeriodSeconds", + "type": "uint32" + } + ], + "internalType": "struct IDrawBeacon.Draw", + "name": "_draw", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_totalNetworkTicketSupply", + "type": "uint256" + } + ], + "name": "push", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "timelock", + "outputs": [ + { + "internalType": "contract IDrawCalculatorTimelock", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x027d86f90df409e1dd94178b7c6759884efd3e179bb517478f858e9c00685cd3", + "receipt": { + "to": null, + "from": "0x4D40eb12430A57965cEe3015348d490C6156dF20", + "contractAddress": "0x94f23320ac3Ed351782791506266351eb4183e8d", + "transactionIndex": 22, + "gasUsed": "653742", + "logsBloom": "0x000000000000000000000000000000000000000000000000008000000000000000000080000010000000000000c0000000008000000000000000001000000000000000000000000000000000000000800001000000000000000100020400000000000000020000000000001000000800000000010000000080000000000000400000000000000002000800000000000000000000000000000000000000000000200000000010000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000100000000020000000000000000000000000810000000000000000000000000000000123100000", + "blockHash": "0x90e8c3fa6bb5aa4c46af81935ceccd55bfd9e84a77b6731f1c11c7e36f1de433", + "transactionHash": "0x027d86f90df409e1dd94178b7c6759884efd3e179bb517478f858e9c00685cd3", + "logs": [ + { + "transactionIndex": 22, + "blockNumber": 36229434, + "transactionHash": "0x027d86f90df409e1dd94178b7c6759884efd3e179bb517478f858e9c00685cd3", + "address": "0x94f23320ac3Ed351782791506266351eb4183e8d", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004d40eb12430a57965cee3015348d490c6156df20" + ], + "data": "0x", + "logIndex": 86, + "blockHash": "0x90e8c3fa6bb5aa4c46af81935ceccd55bfd9e84a77b6731f1c11c7e36f1de433" + }, + { + "transactionIndex": 22, + "blockNumber": 36229434, + "transactionHash": "0x027d86f90df409e1dd94178b7c6759884efd3e179bb517478f858e9c00685cd3", + "address": "0x94f23320ac3Ed351782791506266351eb4183e8d", + "topics": [ + "0x09e48df7857bd0c1e0d31bb8a85d42cf1874817895f171c917f6ee2cea73ec20", + "0x00000000000000000000000038004713b1793f00c5b497e3ecc1a50697e5ffae", + "0x0000000000000000000000000c22044b0aa634e26c5b5e50e2b958c7af59c161" + ], + "data": "0x", + "logIndex": 87, + "blockHash": "0x90e8c3fa6bb5aa4c46af81935ceccd55bfd9e84a77b6731f1c11c7e36f1de433" + }, + { + "transactionIndex": 22, + "blockNumber": 36229434, + "transactionHash": "0x027d86f90df409e1dd94178b7c6759884efd3e179bb517478f858e9c00685cd3", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x0000000000000000000000004d40eb12430a57965cee3015348d490c6156df20", + "0x000000000000000000000000794e44d1334a56fea7f4df12633b88820d0c5888" + ], + "data": "0x00000000000000000000000000000000000000000000000000480eefbe82f9fc0000000000000000000000000000000000000000000000001f14e431614cbe920000000000000000000000000000000000000000000001904060225452c9e4f40000000000000000000000000000000000000000000000001eccd541a2c9c49600000000000000000000000000000000000000000000019040a83144114cdef0", + "logIndex": 88, + "blockHash": "0x90e8c3fa6bb5aa4c46af81935ceccd55bfd9e84a77b6731f1c11c7e36f1de433" + } + ], + "blockNumber": 36229434, + "cumulativeGasUsed": "4309884", + "status": 1, + "byzantium": true + }, + "args": [ + "0x4D40eb12430A57965cEe3015348d490C6156dF20", + "0x38004713B1793f00c5B497E3eCC1a50697e5FfaE", + "0x0C22044B0aA634e26C5B5e50E2B958C7aF59c161" + ], + "numDeployments": 1, + "solcInputHash": "81bc9ae0cb2caeb2744ac5c81556a380", + "metadata": "{\"compiler\":{\"version\":\"0.8.6+commit.11564f7e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"contract IPrizeDistributionFactory\",\"name\":\"_prizeDistributionFactory\",\"type\":\"address\"},{\"internalType\":\"contract IDrawCalculatorTimelock\",\"name\":\"_timelock\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IPrizeDistributionFactory\",\"name\":\"prizeDistributionFactory\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IDrawCalculatorTimelock\",\"name\":\"timelock\",\"type\":\"address\"}],\"name\":\"Deployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"drawId\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"winningRandomNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"drawId\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"beaconPeriodStartedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"beaconPeriodSeconds\",\"type\":\"uint32\"}],\"indexed\":false,\"internalType\":\"struct IDrawBeacon.Draw\",\"name\":\"draw\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalNetworkTicketSupply\",\"type\":\"uint256\"}],\"name\":\"DrawLockedAndTotalNetworkTicketSupplyPushed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"ManagerTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pendingOwner\",\"type\":\"address\"}],\"name\":\"OwnershipOffered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"claimOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"prizeDistributionFactory\",\"outputs\":[{\"internalType\":\"contract IPrizeDistributionFactory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"winningRandomNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"drawId\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"beaconPeriodStartedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"beaconPeriodSeconds\",\"type\":\"uint32\"}],\"internalType\":\"struct IDrawBeacon.Draw\",\"name\":\"_draw\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_totalNetworkTicketSupply\",\"type\":\"uint256\"}],\"name\":\"push\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"timelock\",\"outputs\":[{\"internalType\":\"contract IDrawCalculatorTimelock\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"PoolTogether Inc Team\",\"kind\":\"dev\",\"methods\":{\"claimOwnership()\":{\"details\":\"This function is only callable by the `_pendingOwner`.\"},\"constructor\":{\"params\":{\"_owner\":\"The smart contract owner\",\"_prizeDistributionFactory\":\"PrizeDistributionFactory address\",\"_timelock\":\"DrawCalculatorTimelock address\"}},\"manager()\":{\"returns\":{\"_0\":\"Current `_manager` address.\"}},\"pendingOwner()\":{\"returns\":{\"_0\":\"Current `_pendingOwner` address.\"}},\"push((uint256,uint32,uint64,uint64,uint32),uint256)\":{\"details\":\"Restricts new draws for N seconds by forcing timelock on the next target draw id.\",\"params\":{\"draw\":\"Draw\",\"totalNetworkTicketSupply\":\"totalNetworkTicketSupply\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setManager(address)\":{\"details\":\"Throws if called by any account other than the owner.\",\"params\":{\"_newManager\":\"New _manager address.\"},\"returns\":{\"_0\":\"Boolean to indicate if the operation was successful or not.\"}},\"transferOwnership(address)\":{\"params\":{\"_newOwner\":\"Address to transfer ownership to.\"}}},\"title\":\"PoolTogether V4 BeaconTimelockTrigger\",\"version\":1},\"userdoc\":{\"events\":{\"Deployed(address,address)\":{\"notice\":\"Emitted when the contract is deployed.\"},\"DrawLockedAndTotalNetworkTicketSupplyPushed(uint32,(uint256,uint32,uint64,uint64,uint32),uint256)\":{\"notice\":\"Emitted when Draw is locked and totalNetworkTicketSupply is pushed to PrizeDistributionFactory\"}},\"kind\":\"user\",\"methods\":{\"claimOwnership()\":{\"notice\":\"Allows the `_pendingOwner` address to finalize the transfer.\"},\"constructor\":{\"notice\":\"Initialize BeaconTimelockTrigger smart contract.\"},\"manager()\":{\"notice\":\"Gets current `_manager`.\"},\"owner()\":{\"notice\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"notice\":\"Gets current `_pendingOwner`.\"},\"prizeDistributionFactory()\":{\"notice\":\"PrizeDistributionFactory reference.\"},\"push((uint256,uint32,uint64,uint64,uint32),uint256)\":{\"notice\":\"Locks next Draw and pushes totalNetworkTicketSupply to PrizeDistributionFactory\"},\"renounceOwnership()\":{\"notice\":\"Renounce ownership of the contract.\"},\"setManager(address)\":{\"notice\":\"Set or change of manager.\"},\"timelock()\":{\"notice\":\"DrawCalculatorTimelock reference.\"},\"transferOwnership(address)\":{\"notice\":\"Allows current owner to set the `_pendingOwner` address.\"}},\"notice\":\"The BeaconTimelockTrigger smart contract is an upgrade of the L1TimelockTimelock smart contract. Reducing protocol risk by eliminating off-chain computation of PrizeDistribution parameters. The timelock will only pass the total supply of all tickets in a \\\"PrizePool Network\\\" to the prize distribution factory contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@pooltogether/v4-timelocks/contracts/BeaconTimelockTrigger.sol\":\"BeaconTimelockTrigger\"},\"evmVersion\":\"berlin\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":2000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x61437cb513a887a1bbad006e7b1c8b414478427d33de47c5600af3c748f108da\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc3d946432c0ddbb1f846a0d3985be71299df331b91d06732152117f62f0be2b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n assembly {\\n size := extcodesize(account)\\n }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x51b758a8815ecc9596c66c37d56b1d33883a444631a3f916b9fe65cb863ef7c4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n require(value <= type(uint224).max, \\\"SafeCast: value doesn't fit in 224 bits\\\");\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n require(value <= type(uint128).max, \\\"SafeCast: value doesn't fit in 128 bits\\\");\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n require(value <= type(uint96).max, \\\"SafeCast: value doesn't fit in 96 bits\\\");\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n require(value <= type(uint64).max, \\\"SafeCast: value doesn't fit in 64 bits\\\");\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n require(value <= type(uint32).max, \\\"SafeCast: value doesn't fit in 32 bits\\\");\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n require(value <= type(uint16).max, \\\"SafeCast: value doesn't fit in 16 bits\\\");\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits.\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n require(value <= type(uint8).max, \\\"SafeCast: value doesn't fit in 8 bits\\\");\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128) {\\n require(value >= type(int128).min && value <= type(int128).max, \\\"SafeCast: value doesn't fit in 128 bits\\\");\\n return int128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64) {\\n require(value >= type(int64).min && value <= type(int64).max, \\\"SafeCast: value doesn't fit in 64 bits\\\");\\n return int64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32) {\\n require(value >= type(int32).min && value <= type(int32).max, \\\"SafeCast: value doesn't fit in 32 bits\\\");\\n return int32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16) {\\n require(value >= type(int16).min && value <= type(int16).max, \\\"SafeCast: value doesn't fit in 16 bits\\\");\\n return int16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits.\\n *\\n * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8) {\\n require(value >= type(int8).min && value <= type(int8).max, \\\"SafeCast: value doesn't fit in 8 bits\\\");\\n return int8(value);\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n require(value <= uint256(type(int256).max), \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0x5c6caab697d302ad7eb59c234a4d2dbc965c1bae87709bd2850060b7695b28c7\",\"license\":\"MIT\"},\"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./Ownable.sol\\\";\\n\\n/**\\n * @title Abstract manageable contract that can be inherited by other contracts\\n * @notice Contract module based on Ownable which provides a basic access control mechanism, where\\n * there is an owner and a manager that can be granted exclusive access to specific functions.\\n *\\n * By default, the owner is the deployer of the contract.\\n *\\n * The owner account is set through a two steps process.\\n * 1. The current `owner` calls {transferOwnership} to set a `pendingOwner`\\n * 2. The `pendingOwner` calls {acceptOwnership} to accept the ownership transfer\\n *\\n * The manager account needs to be set using {setManager}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\nabstract contract Manageable is Ownable {\\n address private _manager;\\n\\n /**\\n * @dev Emitted when `_manager` has been changed.\\n * @param previousManager previous `_manager` address.\\n * @param newManager new `_manager` address.\\n */\\n event ManagerTransferred(address indexed previousManager, address indexed newManager);\\n\\n /* ============ External Functions ============ */\\n\\n /**\\n * @notice Gets current `_manager`.\\n * @return Current `_manager` address.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @notice Set or change of manager.\\n * @dev Throws if called by any account other than the owner.\\n * @param _newManager New _manager address.\\n * @return Boolean to indicate if the operation was successful or not.\\n */\\n function setManager(address _newManager) external onlyOwner returns (bool) {\\n return _setManager(_newManager);\\n }\\n\\n /* ============ Internal Functions ============ */\\n\\n /**\\n * @notice Set or change of manager.\\n * @param _newManager New _manager address.\\n * @return Boolean to indicate if the operation was successful or not.\\n */\\n function _setManager(address _newManager) private returns (bool) {\\n address _previousManager = _manager;\\n\\n require(_newManager != _previousManager, \\\"Manageable/existing-manager-address\\\");\\n\\n _manager = _newManager;\\n\\n emit ManagerTransferred(_previousManager, _newManager);\\n return true;\\n }\\n\\n /* ============ Modifier Functions ============ */\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Manageable/caller-not-manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager or the owner.\\n */\\n modifier onlyManagerOrOwner() {\\n require(manager() == msg.sender || owner() == msg.sender, \\\"Manageable/caller-not-manager-or-owner\\\");\\n _;\\n }\\n}\\n\",\"keccak256\":\"0xdd8ac008df192c6aa4df83e7037ab090970fda38e1f9fd712bc0ab5e0485fc04\",\"license\":\"GPL-3.0\"},\"@pooltogether/owner-manager-contracts/contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Abstract ownable contract that can be inherited by other contracts\\n * @notice Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner is the deployer of the contract.\\n *\\n * The owner account is set through a two steps process.\\n * 1. The current `owner` calls {transferOwnership} to set a `pendingOwner`\\n * 2. The `pendingOwner` calls {acceptOwnership} to accept the ownership transfer\\n *\\n * The manager account needs to be set using {setManager}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable {\\n address private _owner;\\n address private _pendingOwner;\\n\\n /**\\n * @dev Emitted when `_pendingOwner` has been changed.\\n * @param pendingOwner new `_pendingOwner` address.\\n */\\n event OwnershipOffered(address indexed pendingOwner);\\n\\n /**\\n * @dev Emitted when `_owner` has been changed.\\n * @param previousOwner previous `_owner` address.\\n * @param newOwner new `_owner` address.\\n */\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /* ============ Deploy ============ */\\n\\n /**\\n * @notice Initializes the contract setting `_initialOwner` as the initial owner.\\n * @param _initialOwner Initial owner of the contract.\\n */\\n constructor(address _initialOwner) {\\n _setOwner(_initialOwner);\\n }\\n\\n /* ============ External Functions ============ */\\n\\n /**\\n * @notice Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @notice Gets current `_pendingOwner`.\\n * @return Current `_pendingOwner` address.\\n */\\n function pendingOwner() external view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @notice Renounce ownership of the contract.\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n _setOwner(address(0));\\n }\\n\\n /**\\n * @notice Allows current owner to set the `_pendingOwner` address.\\n * @param _newOwner Address to transfer ownership to.\\n */\\n function transferOwnership(address _newOwner) external onlyOwner {\\n require(_newOwner != address(0), \\\"Ownable/pendingOwner-not-zero-address\\\");\\n\\n _pendingOwner = _newOwner;\\n\\n emit OwnershipOffered(_newOwner);\\n }\\n\\n /**\\n * @notice Allows the `_pendingOwner` address to finalize the transfer.\\n * @dev This function is only callable by the `_pendingOwner`.\\n */\\n function claimOwnership() external onlyPendingOwner {\\n _setOwner(_pendingOwner);\\n _pendingOwner = address(0);\\n }\\n\\n /* ============ Internal Functions ============ */\\n\\n /**\\n * @notice Internal function to set the `_owner` of the contract.\\n * @param _newOwner New `_owner` address.\\n */\\n function _setOwner(address _newOwner) private {\\n address _oldOwner = _owner;\\n _owner = _newOwner;\\n emit OwnershipTransferred(_oldOwner, _newOwner);\\n }\\n\\n /* ============ Modifier Functions ============ */\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == msg.sender, \\\"Ownable/caller-not-owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the `pendingOwner`.\\n */\\n modifier onlyPendingOwner() {\\n require(msg.sender == _pendingOwner, \\\"Ownable/caller-not-pendingOwner\\\");\\n _;\\n }\\n}\\n\",\"keccak256\":\"0xfd0fd374812c8af45f2633cc7cc4811ccb7bad0a3902a43aded35939eb4a00d1\",\"license\":\"GPL-3.0\"},\"@pooltogether/pooltogether-rng-contracts/contracts/RNGInterface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\n/**\\n * @title Random Number Generator Interface\\n * @notice Provides an interface for requesting random numbers from 3rd-party RNG services (Chainlink VRF, Starkware VDF, etc..)\\n */\\ninterface RNGInterface {\\n /**\\n * @notice Emitted when a new request for a random number has been submitted\\n * @param requestId The indexed ID of the request used to get the results of the RNG service\\n * @param sender The indexed address of the sender of the request\\n */\\n event RandomNumberRequested(uint32 indexed requestId, address indexed sender);\\n\\n /**\\n * @notice Emitted when an existing request for a random number has been completed\\n * @param requestId The indexed ID of the request used to get the results of the RNG service\\n * @param randomNumber The random number produced by the 3rd-party service\\n */\\n event RandomNumberCompleted(uint32 indexed requestId, uint256 randomNumber);\\n\\n /**\\n * @notice Gets the last request id used by the RNG service\\n * @return requestId The last request id used in the last request\\n */\\n function getLastRequestId() external view returns (uint32 requestId);\\n\\n /**\\n * @notice Gets the Fee for making a Request against an RNG service\\n * @return feeToken The address of the token that is used to pay fees\\n * @return requestFee The fee required to be paid to make a request\\n */\\n function getRequestFee() external view returns (address feeToken, uint256 requestFee);\\n\\n /**\\n * @notice Sends a request for a random number to the 3rd-party service\\n * @dev Some services will complete the request immediately, others may have a time-delay\\n * @dev Some services require payment in the form of a token, such as $LINK for Chainlink VRF\\n * @return requestId The ID of the request used to get the results of the RNG service\\n * @return lockBlock The block number at which the RNG service will start generating time-delayed randomness.\\n * The calling contract should \\\"lock\\\" all activity until the result is available via the `requestId`\\n */\\n function requestRandomNumber() external returns (uint32 requestId, uint32 lockBlock);\\n\\n /**\\n * @notice Checks if the request for randomness from the 3rd-party service has completed\\n * @dev For time-delayed requests, this function is used to check/confirm completion\\n * @param requestId The ID of the request used to get the results of the RNG service\\n * @return isCompleted True if the request has completed and a random number is available, false otherwise\\n */\\n function isRequestComplete(uint32 requestId) external view returns (bool isCompleted);\\n\\n /**\\n * @notice Gets the random number produced by the 3rd-party service\\n * @param requestId The ID of the request used to get the results of the RNG service\\n * @return randomNum The random number\\n */\\n function randomNumber(uint32 requestId) external returns (uint256 randomNum);\\n}\\n\",\"keccak256\":\"0x24803ae776bba768a3a3f65d3b7e5fc100c7b5881a8e5e39d6c5df2735a3b5cb\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/PrizeDistributionBuffer.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\\\";\\n\\nimport \\\"./libraries/DrawRingBufferLib.sol\\\";\\nimport \\\"./interfaces/IPrizeDistributionBuffer.sol\\\";\\n\\n/**\\n * @title PoolTogether V4 PrizeDistributionBuffer\\n * @author PoolTogether Inc Team\\n * @notice The PrizeDistributionBuffer contract provides historical lookups of PrizeDistribution struct parameters (linked with a Draw ID) via a\\n circular ring buffer. Historical PrizeDistribution parameters can be accessed on-chain using a drawId to calculate\\n ring buffer storage slot. The PrizeDistribution parameters can be created by manager/owner and existing PrizeDistribution\\n parameters can only be updated the owner. When adding a new PrizeDistribution basic sanity checks will be used to\\n validate the incoming parameters.\\n*/\\ncontract PrizeDistributionBuffer is IPrizeDistributionBuffer, Manageable {\\n using DrawRingBufferLib for DrawRingBufferLib.Buffer;\\n\\n /// @notice The maximum cardinality of the prize distribution ring buffer.\\n /// @dev even with daily draws, 256 will give us over 8 months of history.\\n uint256 internal constant MAX_CARDINALITY = 256;\\n\\n /// @notice The ceiling for prize distributions. 1e9 = 100%.\\n /// @dev It's fixed point 9 because 1e9 is the largest \\\"1\\\" that fits into 2**32\\n uint256 internal constant TIERS_CEILING = 1e9;\\n\\n /// @notice Emitted when the contract is deployed.\\n /// @param cardinality The maximum number of records in the buffer before they begin to expire.\\n event Deployed(uint8 cardinality);\\n\\n /// @notice PrizeDistribution ring buffer history.\\n IPrizeDistributionBuffer.PrizeDistribution[MAX_CARDINALITY]\\n internal prizeDistributionRingBuffer;\\n\\n /// @notice Ring buffer metadata (nextIndex, lastId, cardinality)\\n DrawRingBufferLib.Buffer internal bufferMetadata;\\n\\n /* ============ Constructor ============ */\\n\\n /**\\n * @notice Constructor for PrizeDistributionBuffer\\n * @param _owner Address of the PrizeDistributionBuffer owner\\n * @param _cardinality Cardinality of the `bufferMetadata`\\n */\\n constructor(address _owner, uint8 _cardinality) Ownable(_owner) {\\n bufferMetadata.cardinality = _cardinality;\\n emit Deployed(_cardinality);\\n }\\n\\n /* ============ External Functions ============ */\\n\\n /// @inheritdoc IPrizeDistributionBuffer\\n function getBufferCardinality() external view override returns (uint32) {\\n return bufferMetadata.cardinality;\\n }\\n\\n /// @inheritdoc IPrizeDistributionBuffer\\n function getPrizeDistribution(uint32 _drawId)\\n external\\n view\\n override\\n returns (IPrizeDistributionBuffer.PrizeDistribution memory)\\n {\\n return _getPrizeDistribution(bufferMetadata, _drawId);\\n }\\n\\n /// @inheritdoc IPrizeDistributionSource\\n function getPrizeDistributions(uint32[] calldata _drawIds)\\n external\\n view\\n override\\n returns (IPrizeDistributionBuffer.PrizeDistribution[] memory)\\n {\\n uint256 drawIdsLength = _drawIds.length;\\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\\n IPrizeDistributionBuffer.PrizeDistribution[]\\n memory _prizeDistributions = new IPrizeDistributionBuffer.PrizeDistribution[](\\n drawIdsLength\\n );\\n\\n for (uint256 i = 0; i < drawIdsLength; i++) {\\n _prizeDistributions[i] = _getPrizeDistribution(buffer, _drawIds[i]);\\n }\\n\\n return _prizeDistributions;\\n }\\n\\n /// @inheritdoc IPrizeDistributionBuffer\\n function getPrizeDistributionCount() external view override returns (uint32) {\\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\\n\\n if (buffer.lastDrawId == 0) {\\n return 0;\\n }\\n\\n uint32 bufferNextIndex = buffer.nextIndex;\\n\\n // If the buffer is full return the cardinality, else retun the nextIndex\\n if (prizeDistributionRingBuffer[bufferNextIndex].matchCardinality != 0) {\\n return buffer.cardinality;\\n } else {\\n return bufferNextIndex;\\n }\\n }\\n\\n /// @inheritdoc IPrizeDistributionBuffer\\n function getNewestPrizeDistribution()\\n external\\n view\\n override\\n returns (IPrizeDistributionBuffer.PrizeDistribution memory prizeDistribution, uint32 drawId)\\n {\\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\\n\\n return (prizeDistributionRingBuffer[buffer.getIndex(buffer.lastDrawId)], buffer.lastDrawId);\\n }\\n\\n /// @inheritdoc IPrizeDistributionBuffer\\n function getOldestPrizeDistribution()\\n external\\n view\\n override\\n returns (IPrizeDistributionBuffer.PrizeDistribution memory prizeDistribution, uint32 drawId)\\n {\\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\\n\\n // if the ring buffer is full, the oldest is at the nextIndex\\n prizeDistribution = prizeDistributionRingBuffer[buffer.nextIndex];\\n\\n // The PrizeDistribution at index 0 IS by default the oldest prizeDistribution.\\n if (buffer.lastDrawId == 0) {\\n drawId = 0; // return 0 to indicate no prizeDistribution ring buffer history\\n } else if (prizeDistribution.bitRangeSize == 0) {\\n // IF the next PrizeDistribution.bitRangeSize == 0 the ring buffer HAS NOT looped around so the oldest is the first entry.\\n prizeDistribution = prizeDistributionRingBuffer[0];\\n drawId = (buffer.lastDrawId + 1) - buffer.nextIndex;\\n } else {\\n // Calculates the drawId using the ring buffer cardinality\\n // Sequential drawIds are gauranteed by DrawRingBufferLib.push()\\n drawId = (buffer.lastDrawId + 1) - buffer.cardinality;\\n }\\n }\\n\\n /// @inheritdoc IPrizeDistributionBuffer\\n function pushPrizeDistribution(\\n uint32 _drawId,\\n IPrizeDistributionBuffer.PrizeDistribution calldata _prizeDistribution\\n ) external override onlyManagerOrOwner returns (bool) {\\n return _pushPrizeDistribution(_drawId, _prizeDistribution);\\n }\\n\\n /// @inheritdoc IPrizeDistributionBuffer\\n function setPrizeDistribution(\\n uint32 _drawId,\\n IPrizeDistributionBuffer.PrizeDistribution calldata _prizeDistribution\\n ) external override onlyOwner returns (uint32) {\\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\\n uint32 index = buffer.getIndex(_drawId);\\n prizeDistributionRingBuffer[index] = _prizeDistribution;\\n\\n emit PrizeDistributionSet(_drawId, _prizeDistribution);\\n\\n return _drawId;\\n }\\n\\n /* ============ Internal Functions ============ */\\n\\n /**\\n * @notice Gets the PrizeDistributionBuffer for a drawId\\n * @param _buffer DrawRingBufferLib.Buffer\\n * @param _drawId drawId\\n */\\n function _getPrizeDistribution(DrawRingBufferLib.Buffer memory _buffer, uint32 _drawId)\\n internal\\n view\\n returns (IPrizeDistributionBuffer.PrizeDistribution memory)\\n {\\n return prizeDistributionRingBuffer[_buffer.getIndex(_drawId)];\\n }\\n\\n /**\\n * @notice Set newest PrizeDistributionBuffer in ring buffer storage.\\n * @param _drawId drawId\\n * @param _prizeDistribution PrizeDistributionBuffer struct\\n */\\n function _pushPrizeDistribution(\\n uint32 _drawId,\\n IPrizeDistributionBuffer.PrizeDistribution calldata _prizeDistribution\\n ) internal returns (bool) {\\n require(_drawId > 0, \\\"DrawCalc/draw-id-gt-0\\\");\\n require(_prizeDistribution.matchCardinality > 0, \\\"DrawCalc/matchCardinality-gt-0\\\");\\n require(\\n _prizeDistribution.bitRangeSize <= 256 / _prizeDistribution.matchCardinality,\\n \\\"DrawCalc/bitRangeSize-too-large\\\"\\n );\\n\\n require(_prizeDistribution.bitRangeSize > 0, \\\"DrawCalc/bitRangeSize-gt-0\\\");\\n require(_prizeDistribution.maxPicksPerUser > 0, \\\"DrawCalc/maxPicksPerUser-gt-0\\\");\\n require(_prizeDistribution.expiryDuration > 0, \\\"DrawCalc/expiryDuration-gt-0\\\");\\n\\n // ensure that the sum of the tiers are not gt 100%\\n uint256 sumTotalTiers = 0;\\n uint256 tiersLength = _prizeDistribution.tiers.length;\\n\\n for (uint256 index = 0; index < tiersLength; index++) {\\n uint256 tier = _prizeDistribution.tiers[index];\\n sumTotalTiers += tier;\\n }\\n\\n // Each tier amount stored as uint32 - summed can't exceed 1e9\\n require(sumTotalTiers <= TIERS_CEILING, \\\"DrawCalc/tiers-gt-100%\\\");\\n\\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\\n\\n // store the PrizeDistribution in the ring buffer\\n prizeDistributionRingBuffer[buffer.nextIndex] = _prizeDistribution;\\n\\n // update the ring buffer data\\n bufferMetadata = buffer.push(_drawId);\\n\\n emit PrizeDistributionSet(_drawId, _prizeDistribution);\\n\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0xdfcc3dc33457e44d8917f33185925eff78ea21e5018250b3accf2db8a7aa0242\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/PrizeDistributor.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@pooltogether/owner-manager-contracts/contracts/Ownable.sol\\\";\\n\\nimport \\\"./interfaces/IPrizeDistributor.sol\\\";\\nimport \\\"./interfaces/IDrawCalculator.sol\\\";\\n\\n/**\\n * @title PoolTogether V4 PrizeDistributor\\n * @author PoolTogether Inc Team\\n * @notice The PrizeDistributor contract holds Tickets (captured interest) and distributes tickets to users with winning draw claims.\\n PrizeDistributor uses an external IDrawCalculator to validate a users draw claim, before awarding payouts. To prevent users \\n from reclaiming prizes, a payout history for each draw claim is mapped to user accounts. Reclaiming a draw can occur\\n if an \\\"optimal\\\" prize was not included in previous claim pick indices and the new claims updated payout is greater then\\n the previous prize distributor claim payout.\\n*/\\ncontract PrizeDistributor is IPrizeDistributor, Ownable {\\n using SafeERC20 for IERC20;\\n\\n /* ============ Global Variables ============ */\\n\\n /// @notice DrawCalculator address\\n IDrawCalculator internal drawCalculator;\\n\\n /// @notice Token address\\n IERC20 internal immutable token;\\n\\n /// @notice Maps users => drawId => paid out balance\\n mapping(address => mapping(uint256 => uint256)) internal userDrawPayouts;\\n\\n /* ============ Initialize ============ */\\n\\n /**\\n * @notice Initialize PrizeDistributor smart contract.\\n * @param _owner Owner address\\n * @param _token Token address\\n * @param _drawCalculator DrawCalculator address\\n */\\n constructor(\\n address _owner,\\n IERC20 _token,\\n IDrawCalculator _drawCalculator\\n ) Ownable(_owner) {\\n _setDrawCalculator(_drawCalculator);\\n require(address(_token) != address(0), \\\"PrizeDistributor/token-not-zero-address\\\");\\n token = _token;\\n emit TokenSet(_token);\\n }\\n\\n /* ============ External Functions ============ */\\n\\n /// @inheritdoc IPrizeDistributor\\n function claim(\\n address _user,\\n uint32[] calldata _drawIds,\\n bytes calldata _data\\n ) external override returns (uint256) {\\n \\n uint256 totalPayout;\\n \\n (uint256[] memory drawPayouts, ) = drawCalculator.calculate(_user, _drawIds, _data); // neglect the prizeCounts since we are not interested in them here\\n\\n uint256 drawPayoutsLength = drawPayouts.length;\\n for (uint256 payoutIndex = 0; payoutIndex < drawPayoutsLength; payoutIndex++) {\\n uint32 drawId = _drawIds[payoutIndex];\\n uint256 payout = drawPayouts[payoutIndex];\\n uint256 oldPayout = _getDrawPayoutBalanceOf(_user, drawId);\\n uint256 payoutDiff = 0;\\n\\n // helpfully short-circuit, in case the user screwed something up.\\n require(payout > oldPayout, \\\"PrizeDistributor/zero-payout\\\");\\n\\n unchecked {\\n payoutDiff = payout - oldPayout;\\n }\\n\\n _setDrawPayoutBalanceOf(_user, drawId, payout);\\n\\n totalPayout += payoutDiff;\\n\\n emit ClaimedDraw(_user, drawId, payoutDiff);\\n }\\n\\n _awardPayout(_user, totalPayout);\\n\\n return totalPayout;\\n }\\n\\n /// @inheritdoc IPrizeDistributor\\n function withdrawERC20(\\n IERC20 _erc20Token,\\n address _to,\\n uint256 _amount\\n ) external override onlyOwner returns (bool) {\\n require(_to != address(0), \\\"PrizeDistributor/recipient-not-zero-address\\\");\\n require(address(_erc20Token) != address(0), \\\"PrizeDistributor/ERC20-not-zero-address\\\");\\n\\n _erc20Token.safeTransfer(_to, _amount);\\n\\n emit ERC20Withdrawn(_erc20Token, _to, _amount);\\n\\n return true;\\n }\\n\\n /// @inheritdoc IPrizeDistributor\\n function getDrawCalculator() external view override returns (IDrawCalculator) {\\n return drawCalculator;\\n }\\n\\n /// @inheritdoc IPrizeDistributor\\n function getDrawPayoutBalanceOf(address _user, uint32 _drawId)\\n external\\n view\\n override\\n returns (uint256)\\n {\\n return _getDrawPayoutBalanceOf(_user, _drawId);\\n }\\n\\n /// @inheritdoc IPrizeDistributor\\n function getToken() external view override returns (IERC20) {\\n return token;\\n }\\n\\n /// @inheritdoc IPrizeDistributor\\n function setDrawCalculator(IDrawCalculator _newCalculator)\\n external\\n override\\n onlyOwner\\n returns (IDrawCalculator)\\n {\\n _setDrawCalculator(_newCalculator);\\n return _newCalculator;\\n }\\n\\n /* ============ Internal Functions ============ */\\n\\n function _getDrawPayoutBalanceOf(address _user, uint32 _drawId)\\n internal\\n view\\n returns (uint256)\\n {\\n return userDrawPayouts[_user][_drawId];\\n }\\n\\n function _setDrawPayoutBalanceOf(\\n address _user,\\n uint32 _drawId,\\n uint256 _payout\\n ) internal {\\n userDrawPayouts[_user][_drawId] = _payout;\\n }\\n\\n /**\\n * @notice Sets DrawCalculator reference for individual draw id.\\n * @param _newCalculator DrawCalculator address\\n */\\n function _setDrawCalculator(IDrawCalculator _newCalculator) internal {\\n require(address(_newCalculator) != address(0), \\\"PrizeDistributor/calc-not-zero\\\");\\n drawCalculator = _newCalculator;\\n\\n emit DrawCalculatorSet(_newCalculator);\\n }\\n\\n /**\\n * @notice Transfer claimed draw(s) total payout to user.\\n * @param _to User address\\n * @param _amount Transfer amount\\n */\\n function _awardPayout(address _to, uint256 _amount) internal {\\n token.safeTransfer(_to, _amount);\\n }\\n\\n}\\n\",\"keccak256\":\"0x7bd257c0546ac7d12892e37a58c92ad7b18699e14c18c79ab7f455c904a03226\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/IControlledToken.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/** @title IControlledToken\\n * @author PoolTogether Inc Team\\n * @notice ERC20 Tokens with a controller for minting & burning.\\n*/\\ninterface IControlledToken is IERC20 {\\n\\n /** \\n @notice Interface to the contract responsible for controlling mint/burn\\n */\\n function controller() external view returns (address);\\n\\n /** \\n * @notice Allows the controller to mint tokens for a user account\\n * @dev May be overridden to provide more granular control over minting\\n * @param user Address of the receiver of the minted tokens\\n * @param amount Amount of tokens to mint\\n */\\n function controllerMint(address user, uint256 amount) external;\\n\\n /** \\n * @notice Allows the controller to burn tokens from a user account\\n * @dev May be overridden to provide more granular control over burning\\n * @param user Address of the holder account to burn tokens from\\n * @param amount Amount of tokens to burn\\n */\\n function controllerBurn(address user, uint256 amount) external;\\n\\n /** \\n * @notice Allows an operator via the controller to burn tokens on behalf of a user account\\n * @dev May be overridden to provide more granular control over operator-burning\\n * @param operator Address of the operator performing the burn action via the controller contract\\n * @param user Address of the holder account to burn tokens from\\n * @param amount Amount of tokens to burn\\n */\\n function controllerBurnFrom(\\n address operator,\\n address user,\\n uint256 amount\\n ) external;\\n}\\n\",\"keccak256\":\"0x90dceeec1eea6e49021e8db88b084f3f0c503c60b6f7e0bbecd2529ffde87ef3\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/IDrawBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@pooltogether/pooltogether-rng-contracts/contracts/RNGInterface.sol\\\";\\nimport \\\"./IDrawBuffer.sol\\\";\\n\\n/** @title IDrawBeacon\\n * @author PoolTogether Inc Team\\n * @notice The DrawBeacon interface.\\n*/\\ninterface IDrawBeacon {\\n\\n /// @notice Draw struct created every draw\\n /// @param winningRandomNumber The random number returned from the RNG service\\n /// @param drawId The monotonically increasing drawId for each draw\\n /// @param timestamp Unix timestamp of the draw. Recorded when the draw is created by the DrawBeacon.\\n /// @param beaconPeriodStartedAt Unix timestamp of when the draw started\\n /// @param beaconPeriodSeconds Unix timestamp of the beacon draw period for this draw.\\n struct Draw {\\n uint256 winningRandomNumber;\\n uint32 drawId;\\n uint64 timestamp;\\n uint64 beaconPeriodStartedAt;\\n uint32 beaconPeriodSeconds;\\n }\\n\\n /**\\n * @notice Emit when a new DrawBuffer has been set.\\n * @param newDrawBuffer The new DrawBuffer address\\n */\\n event DrawBufferUpdated(IDrawBuffer indexed newDrawBuffer);\\n\\n /**\\n * @notice Emit when a draw has opened.\\n * @param startedAt Start timestamp\\n */\\n event BeaconPeriodStarted(uint64 indexed startedAt);\\n\\n /**\\n * @notice Emit when a draw has started.\\n * @param rngRequestId draw id\\n * @param rngLockBlock Block when draw becomes invalid\\n */\\n event DrawStarted(uint32 indexed rngRequestId, uint32 rngLockBlock);\\n\\n /**\\n * @notice Emit when a draw has been cancelled.\\n * @param rngRequestId draw id\\n * @param rngLockBlock Block when draw becomes invalid\\n */\\n event DrawCancelled(uint32 indexed rngRequestId, uint32 rngLockBlock);\\n\\n /**\\n * @notice Emit when a draw has been completed.\\n * @param randomNumber Random number generated from draw\\n */\\n event DrawCompleted(uint256 randomNumber);\\n\\n /**\\n * @notice Emit when a RNG service address is set.\\n * @param rngService RNG service address\\n */\\n event RngServiceUpdated(RNGInterface indexed rngService);\\n\\n /**\\n * @notice Emit when a draw timeout param is set.\\n * @param rngTimeout draw timeout param in seconds\\n */\\n event RngTimeoutSet(uint32 rngTimeout);\\n\\n /**\\n * @notice Emit when the drawPeriodSeconds is set.\\n * @param drawPeriodSeconds Time between draw\\n */\\n event BeaconPeriodSecondsUpdated(uint32 drawPeriodSeconds);\\n\\n /**\\n * @notice Returns the number of seconds remaining until the beacon period can be complete.\\n * @return The number of seconds remaining until the beacon period can be complete.\\n */\\n function beaconPeriodRemainingSeconds() external view returns (uint64);\\n\\n /**\\n * @notice Returns the timestamp at which the beacon period ends\\n * @return The timestamp at which the beacon period ends.\\n */\\n function beaconPeriodEndAt() external view returns (uint64);\\n\\n /**\\n * @notice Returns whether a Draw can be started.\\n * @return True if a Draw can be started, false otherwise.\\n */\\n function canStartDraw() external view returns (bool);\\n\\n /**\\n * @notice Returns whether a Draw can be completed.\\n * @return True if a Draw can be completed, false otherwise.\\n */\\n function canCompleteDraw() external view returns (bool);\\n\\n /**\\n * @notice Calculates when the next beacon period will start.\\n * @param time The timestamp to use as the current time\\n * @return The timestamp at which the next beacon period would start\\n */\\n function calculateNextBeaconPeriodStartTime(uint64 time) external view returns (uint64);\\n\\n /**\\n * @notice Can be called by anyone to cancel the draw request if the RNG has timed out.\\n */\\n function cancelDraw() external;\\n\\n /**\\n * @notice Completes the Draw (RNG) request and pushes a Draw onto DrawBuffer.\\n */\\n function completeDraw() external;\\n\\n /**\\n * @notice Returns the block number that the current RNG request has been locked to.\\n * @return The block number that the RNG request is locked to\\n */\\n function getLastRngLockBlock() external view returns (uint32);\\n\\n /**\\n * @notice Returns the current RNG Request ID.\\n * @return The current Request ID\\n */\\n function getLastRngRequestId() external view returns (uint32);\\n\\n /**\\n * @notice Returns whether the beacon period is over\\n * @return True if the beacon period is over, false otherwise\\n */\\n function isBeaconPeriodOver() external view returns (bool);\\n\\n /**\\n * @notice Returns whether the random number request has completed.\\n * @return True if a random number request has completed, false otherwise.\\n */\\n function isRngCompleted() external view returns (bool);\\n\\n /**\\n * @notice Returns whether a random number has been requested\\n * @return True if a random number has been requested, false otherwise.\\n */\\n function isRngRequested() external view returns (bool);\\n\\n /**\\n * @notice Returns whether the random number request has timed out.\\n * @return True if a random number request has timed out, false otherwise.\\n */\\n function isRngTimedOut() external view returns (bool);\\n\\n /**\\n * @notice Allows the owner to set the beacon period in seconds.\\n * @param beaconPeriodSeconds The new beacon period in seconds. Must be greater than zero.\\n */\\n function setBeaconPeriodSeconds(uint32 beaconPeriodSeconds) external;\\n\\n /**\\n * @notice Allows the owner to set the RNG request timeout in seconds. This is the time that must elapsed before the RNG request can be cancelled and the pool unlocked.\\n * @param rngTimeout The RNG request timeout in seconds.\\n */\\n function setRngTimeout(uint32 rngTimeout) external;\\n\\n /**\\n * @notice Sets the RNG service that the Prize Strategy is connected to\\n * @param rngService The address of the new RNG service interface\\n */\\n function setRngService(RNGInterface rngService) external;\\n\\n /**\\n * @notice Starts the Draw process by starting random number request. The previous beacon period must have ended.\\n * @dev The RNG-Request-Fee is expected to be held within this contract before calling this function\\n */\\n function startDraw() external;\\n\\n /**\\n * @notice Set global DrawBuffer variable.\\n * @dev All subsequent Draw requests/completions will be pushed to the new DrawBuffer.\\n * @param newDrawBuffer DrawBuffer address\\n * @return DrawBuffer\\n */\\n function setDrawBuffer(IDrawBuffer newDrawBuffer) external returns (IDrawBuffer);\\n}\\n\",\"keccak256\":\"0x43213073a191399978af2c7464c5e39af09efeeb503005d4e2a79705c40baa32\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/IDrawBuffer.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"../interfaces/IDrawBeacon.sol\\\";\\n\\n/** @title IDrawBuffer\\n * @author PoolTogether Inc Team\\n * @notice The DrawBuffer interface.\\n*/\\ninterface IDrawBuffer {\\n /**\\n * @notice Emit when a new draw has been created.\\n * @param drawId Draw id\\n * @param draw The Draw struct\\n */\\n event DrawSet(uint32 indexed drawId, IDrawBeacon.Draw draw);\\n\\n /**\\n * @notice Read a ring buffer cardinality\\n * @return Ring buffer cardinality\\n */\\n function getBufferCardinality() external view returns (uint32);\\n\\n /**\\n * @notice Read a Draw from the draws ring buffer.\\n * @dev Read a Draw using the Draw.drawId to calculate position in the draws ring buffer.\\n * @param drawId Draw.drawId\\n * @return IDrawBeacon.Draw\\n */\\n function getDraw(uint32 drawId) external view returns (IDrawBeacon.Draw memory);\\n\\n /**\\n * @notice Read multiple Draws from the draws ring buffer.\\n * @dev Read multiple Draws using each drawId to calculate position in the draws ring buffer.\\n * @param drawIds Array of drawIds\\n * @return IDrawBeacon.Draw[]\\n */\\n function getDraws(uint32[] calldata drawIds) external view returns (IDrawBeacon.Draw[] memory);\\n\\n /**\\n * @notice Gets the number of Draws held in the draw ring buffer.\\n * @dev If no Draws have been pushed, it will return 0.\\n * @dev If the ring buffer is full, it will return the cardinality.\\n * @dev Otherwise, it will return the NewestDraw index + 1.\\n * @return Number of Draws held in the draw ring buffer.\\n */\\n function getDrawCount() external view returns (uint32);\\n\\n /**\\n * @notice Read newest Draw from draws ring buffer.\\n * @dev Uses the nextDrawIndex to calculate the most recently added Draw.\\n * @return IDrawBeacon.Draw\\n */\\n function getNewestDraw() external view returns (IDrawBeacon.Draw memory);\\n\\n /**\\n * @notice Read oldest Draw from draws ring buffer.\\n * @dev Finds the oldest Draw by comparing and/or diffing totalDraws with the cardinality.\\n * @return IDrawBeacon.Draw\\n */\\n function getOldestDraw() external view returns (IDrawBeacon.Draw memory);\\n\\n /**\\n * @notice Push Draw onto draws ring buffer history.\\n * @dev Push new draw onto draws history via authorized manager or owner.\\n * @param draw IDrawBeacon.Draw\\n * @return Draw.drawId\\n */\\n function pushDraw(IDrawBeacon.Draw calldata draw) external returns (uint32);\\n\\n /**\\n * @notice Set existing Draw in draws ring buffer with new parameters.\\n * @dev Updating a Draw should be used sparingly and only in the event an incorrect Draw parameter has been stored.\\n * @param newDraw IDrawBeacon.Draw\\n * @return Draw.drawId\\n */\\n function setDraw(IDrawBeacon.Draw calldata newDraw) external returns (uint32);\\n}\\n\",\"keccak256\":\"0x209ff20406b6b45ff5eff40af05c41a5d697441fc84e2e015e6828d874ccaa83\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/IDrawCalculator.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"./ITicket.sol\\\";\\nimport \\\"./IDrawBuffer.sol\\\";\\nimport \\\"../PrizeDistributionBuffer.sol\\\";\\nimport \\\"../PrizeDistributor.sol\\\";\\n\\n/**\\n * @title PoolTogether V4 IDrawCalculator\\n * @author PoolTogether Inc Team\\n * @notice The DrawCalculator interface.\\n */\\ninterface IDrawCalculator {\\n struct PickPrize {\\n bool won;\\n uint8 tierIndex;\\n }\\n\\n ///@notice Emitted when the contract is initialized\\n event Deployed(\\n ITicket indexed ticket,\\n IDrawBuffer indexed drawBuffer,\\n IPrizeDistributionBuffer indexed prizeDistributionBuffer\\n );\\n\\n ///@notice Emitted when the prizeDistributor is set/updated\\n event PrizeDistributorSet(PrizeDistributor indexed prizeDistributor);\\n\\n /**\\n * @notice Calculates the prize amount for a user for Multiple Draws. Typically called by a PrizeDistributor.\\n * @param user User for which to calculate prize amount.\\n * @param drawIds drawId array for which to calculate prize amounts for.\\n * @param data The ABI encoded pick indices for all Draws. Expected to be winning picks. Pick indices must be less than the totalUserPicks.\\n * @return List of awardable prize amounts ordered by drawId.\\n */\\n function calculate(\\n address user,\\n uint32[] calldata drawIds,\\n bytes calldata data\\n ) external view returns (uint256[] memory, bytes memory);\\n\\n /**\\n * @notice Read global DrawBuffer variable.\\n * @return IDrawBuffer\\n */\\n function getDrawBuffer() external view returns (IDrawBuffer);\\n\\n /**\\n * @notice Read global prizeDistributionBuffer variable.\\n * @return IPrizeDistributionBuffer\\n */\\n function getPrizeDistributionBuffer() external view returns (IPrizeDistributionBuffer);\\n\\n /**\\n * @notice Returns a users balances expressed as a fraction of the total supply over time.\\n * @param user The users address\\n * @param drawIds The drawIds to consider\\n * @return Array of balances\\n */\\n function getNormalizedBalancesForDrawIds(address user, uint32[] calldata drawIds)\\n external\\n view\\n returns (uint256[] memory);\\n\\n}\\n\",\"keccak256\":\"0x51b3bacbdd715929d909063e66519096c2ef858b646e80f66691d155ccc8d520\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/IPrizeDistributionBuffer.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"./IPrizeDistributionSource.sol\\\";\\n\\n/** @title IPrizeDistributionBuffer\\n * @author PoolTogether Inc Team\\n * @notice The PrizeDistributionBuffer interface.\\n */\\ninterface IPrizeDistributionBuffer is IPrizeDistributionSource {\\n /**\\n * @notice Emit when PrizeDistribution is set.\\n * @param drawId Draw id\\n * @param prizeDistribution IPrizeDistributionBuffer.PrizeDistribution\\n */\\n event PrizeDistributionSet(\\n uint32 indexed drawId,\\n IPrizeDistributionBuffer.PrizeDistribution prizeDistribution\\n );\\n\\n /**\\n * @notice Read a ring buffer cardinality\\n * @return Ring buffer cardinality\\n */\\n function getBufferCardinality() external view returns (uint32);\\n\\n /**\\n * @notice Read newest PrizeDistribution from prize distributions ring buffer.\\n * @dev Uses nextDrawIndex to calculate the most recently added PrizeDistribution.\\n * @return prizeDistribution\\n * @return drawId\\n */\\n function getNewestPrizeDistribution()\\n external\\n view\\n returns (\\n IPrizeDistributionBuffer.PrizeDistribution memory prizeDistribution,\\n uint32 drawId\\n );\\n\\n /**\\n * @notice Read oldest PrizeDistribution from prize distributions ring buffer.\\n * @dev Finds the oldest Draw by buffer.nextIndex and buffer.lastDrawId\\n * @return prizeDistribution\\n * @return drawId\\n */\\n function getOldestPrizeDistribution()\\n external\\n view\\n returns (\\n IPrizeDistributionBuffer.PrizeDistribution memory prizeDistribution,\\n uint32 drawId\\n );\\n\\n /**\\n * @notice Gets the PrizeDistributionBuffer for a drawId\\n * @param drawId drawId\\n * @return prizeDistribution\\n */\\n function getPrizeDistribution(uint32 drawId)\\n external\\n view\\n returns (IPrizeDistributionBuffer.PrizeDistribution memory);\\n\\n /**\\n * @notice Gets the number of PrizeDistributions stored in the prize distributions ring buffer.\\n * @dev If no Draws have been pushed, it will return 0.\\n * @dev If the ring buffer is full, it will return the cardinality.\\n * @dev Otherwise, it will return the NewestPrizeDistribution index + 1.\\n * @return Number of PrizeDistributions stored in the prize distributions ring buffer.\\n */\\n function getPrizeDistributionCount() external view returns (uint32);\\n\\n /**\\n * @notice Adds new PrizeDistribution record to ring buffer storage.\\n * @dev Only callable by the owner or manager\\n * @param drawId Draw ID linked to PrizeDistribution parameters\\n * @param prizeDistribution PrizeDistribution parameters struct\\n */\\n function pushPrizeDistribution(\\n uint32 drawId,\\n IPrizeDistributionBuffer.PrizeDistribution calldata prizeDistribution\\n ) external returns (bool);\\n\\n /**\\n * @notice Sets existing PrizeDistribution with new PrizeDistribution parameters in ring buffer storage.\\n * @dev Retroactively updates an existing PrizeDistribution and should be thought of as a \\\"safety\\\"\\n fallback. If the manager is setting invalid PrizeDistribution parameters the Owner can update\\n the invalid parameters with correct parameters.\\n * @return drawId\\n */\\n function setPrizeDistribution(\\n uint32 drawId,\\n IPrizeDistributionBuffer.PrizeDistribution calldata draw\\n ) external returns (uint32);\\n}\\n\",\"keccak256\":\"0xa66b0d958502adda03e80924381bae30802f1c8d80823a9b787b8c66f6a7d835\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/IPrizeDistributionSource.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\n/** @title IPrizeDistributionSource\\n * @author PoolTogether Inc Team\\n * @notice The PrizeDistributionSource interface.\\n */\\ninterface IPrizeDistributionSource {\\n ///@notice PrizeDistribution struct created every draw\\n ///@param bitRangeSize Decimal representation of bitRangeSize\\n ///@param matchCardinality The number of numbers to consider in the 256 bit random number. Must be > 1 and < 256/bitRangeSize.\\n ///@param startTimestampOffset The starting time offset in seconds from which Ticket balances are calculated.\\n ///@param endTimestampOffset The end time offset in seconds from which Ticket balances are calculated.\\n ///@param maxPicksPerUser Maximum number of picks a user can make in this draw\\n ///@param expiryDuration Length of time in seconds the PrizeDistribution is valid for. Relative to the Draw.timestamp.\\n ///@param numberOfPicks Number of picks this draw has (may vary across networks according to how much the network has contributed to the Reserve)\\n ///@param tiers Array of prize tiers percentages, expressed in fraction form with base 1e9. Ordering: index0: grandPrize, index1: runnerUp, etc.\\n ///@param prize Total prize amount available in this draw calculator for this draw (may vary from across networks)\\n struct PrizeDistribution {\\n uint8 bitRangeSize;\\n uint8 matchCardinality;\\n uint32 startTimestampOffset;\\n uint32 endTimestampOffset;\\n uint32 maxPicksPerUser;\\n uint32 expiryDuration;\\n uint104 numberOfPicks;\\n uint32[16] tiers;\\n uint256 prize;\\n }\\n\\n /**\\n * @notice Gets PrizeDistribution list from array of drawIds\\n * @param drawIds drawIds to get PrizeDistribution for\\n * @return prizeDistributionList\\n */\\n function getPrizeDistributions(uint32[] calldata drawIds)\\n external\\n view\\n returns (PrizeDistribution[] memory);\\n}\\n\",\"keccak256\":\"0x05ec47edc2684790a869a866576e7338229cc4eeafe1171bfc8cd7fa1c0cc9a0\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/IPrizeDistributor.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.6;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IDrawBuffer.sol\\\";\\nimport \\\"./IDrawCalculator.sol\\\";\\n\\n/** @title IPrizeDistributor\\n * @author PoolTogether Inc Team\\n * @notice The PrizeDistributor interface.\\n*/\\ninterface IPrizeDistributor {\\n\\n /**\\n * @notice Emit when user has claimed token from the PrizeDistributor.\\n * @param user User address receiving draw claim payouts\\n * @param drawId Draw id that was paid out\\n * @param payout Payout for draw\\n */\\n event ClaimedDraw(address indexed user, uint32 indexed drawId, uint256 payout);\\n\\n /**\\n * @notice Emit when DrawCalculator is set.\\n * @param calculator DrawCalculator address\\n */\\n event DrawCalculatorSet(IDrawCalculator indexed calculator);\\n\\n /**\\n * @notice Emit when Token is set.\\n * @param token Token address\\n */\\n event TokenSet(IERC20 indexed token);\\n\\n /**\\n * @notice Emit when ERC20 tokens are withdrawn.\\n * @param token ERC20 token transferred.\\n * @param to Address that received funds.\\n * @param amount Amount of tokens transferred.\\n */\\n event ERC20Withdrawn(IERC20 indexed token, address indexed to, uint256 amount);\\n\\n /**\\n * @notice Claim prize payout(s) by submitting valud drawId(s) and winning pick indice(s). The user address\\n is used as the \\\"seed\\\" phrase to generate random numbers.\\n * @dev The claim function is public and any wallet may execute claim on behalf of another user.\\n Prizes are always paid out to the designated user account and not the caller (msg.sender).\\n Claiming prizes is not limited to a single transaction. Reclaiming can be executed\\n subsequentially if an \\\"optimal\\\" prize was not included in previous claim pick indices. The\\n payout difference for the new claim is calculated during the award process and transfered to user.\\n * @param user Address of user to claim awards for. Does NOT need to be msg.sender\\n * @param drawIds Draw IDs from global DrawBuffer reference\\n * @param data The data to pass to the draw calculator\\n * @return Total claim payout. May include calcuations from multiple draws.\\n */\\n function claim(\\n address user,\\n uint32[] calldata drawIds,\\n bytes calldata data\\n ) external returns (uint256);\\n\\n /**\\n * @notice Read global DrawCalculator address.\\n * @return IDrawCalculator\\n */\\n function getDrawCalculator() external view returns (IDrawCalculator);\\n\\n /**\\n * @notice Get the amount that a user has already been paid out for a draw\\n * @param user User address\\n * @param drawId Draw ID\\n */\\n function getDrawPayoutBalanceOf(address user, uint32 drawId) external view returns (uint256);\\n\\n /**\\n * @notice Read global Ticket address.\\n * @return IERC20\\n */\\n function getToken() external view returns (IERC20);\\n\\n /**\\n * @notice Sets DrawCalculator reference contract.\\n * @param newCalculator DrawCalculator address\\n * @return New DrawCalculator address\\n */\\n function setDrawCalculator(IDrawCalculator newCalculator) external returns (IDrawCalculator);\\n\\n /**\\n * @notice Transfer ERC20 tokens out of contract to recipient address.\\n * @dev Only callable by contract owner.\\n * @param token ERC20 token to transfer.\\n * @param to Recipient of the tokens.\\n * @param amount Amount of tokens to transfer.\\n * @return true if operation is successful.\\n */\\n function withdrawERC20(\\n IERC20 token,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x98f9ff8388e7fd867e89b19469e02fc381fd87ef534cf71eef4e2fb3e4d32fa1\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/ITicket.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"../libraries/TwabLib.sol\\\";\\nimport \\\"./IControlledToken.sol\\\";\\n\\ninterface ITicket is IControlledToken {\\n /**\\n * @notice A struct containing details for an Account.\\n * @param balance The current balance for an Account.\\n * @param nextTwabIndex The next available index to store a new twab.\\n * @param cardinality The number of recorded twabs (plus one!).\\n */\\n struct AccountDetails {\\n uint224 balance;\\n uint16 nextTwabIndex;\\n uint16 cardinality;\\n }\\n\\n /**\\n * @notice Combines account details with their twab history.\\n * @param details The account details.\\n * @param twabs The history of twabs for this account.\\n */\\n struct Account {\\n AccountDetails details;\\n ObservationLib.Observation[65535] twabs;\\n }\\n\\n /**\\n * @notice Emitted when TWAB balance has been delegated to another user.\\n * @param delegator Address of the delegator.\\n * @param delegate Address of the delegate.\\n */\\n event Delegated(address indexed delegator, address indexed delegate);\\n\\n /**\\n * @notice Emitted when ticket is initialized.\\n * @param name Ticket name (eg: PoolTogether Dai Ticket (Compound)).\\n * @param symbol Ticket symbol (eg: PcDAI).\\n * @param decimals Ticket decimals.\\n * @param controller Token controller address.\\n */\\n event TicketInitialized(string name, string symbol, uint8 decimals, address indexed controller);\\n\\n /**\\n * @notice Emitted when a new TWAB has been recorded.\\n * @param delegate The recipient of the ticket power (may be the same as the user).\\n * @param newTwab Updated TWAB of a ticket holder after a successful TWAB recording.\\n */\\n event NewUserTwab(\\n address indexed delegate,\\n ObservationLib.Observation newTwab\\n );\\n\\n /**\\n * @notice Emitted when a new total supply TWAB has been recorded.\\n * @param newTotalSupplyTwab Updated TWAB of tickets total supply after a successful total supply TWAB recording.\\n */\\n event NewTotalSupplyTwab(ObservationLib.Observation newTotalSupplyTwab);\\n\\n /**\\n * @notice Retrieves the address of the delegate to whom `user` has delegated their tickets.\\n * @dev Address of the delegate will be the zero address if `user` has not delegated their tickets.\\n * @param user Address of the delegator.\\n * @return Address of the delegate.\\n */\\n function delegateOf(address user) external view returns (address);\\n\\n /**\\n * @notice Delegate time-weighted average balances to an alternative address.\\n * @dev Transfers (including mints) trigger the storage of a TWAB in delegate(s) account, instead of the\\n targetted sender and/or recipient address(s).\\n * @dev To reset the delegate, pass the zero address (0x000.000) as `to` parameter.\\n * @dev Current delegate address should be different from the new delegate address `to`.\\n * @param to Recipient of delegated TWAB.\\n */\\n function delegate(address to) external;\\n\\n /**\\n * @notice Allows the controller to delegate on a users behalf.\\n * @param user The user for whom to delegate\\n * @param delegate The new delegate\\n */\\n function controllerDelegateFor(address user, address delegate) external;\\n\\n /**\\n * @notice Allows a user to delegate via signature\\n * @param user The user who is delegating\\n * @param delegate The new delegate\\n * @param deadline The timestamp by which this must be submitted\\n * @param v The v portion of the ECDSA sig\\n * @param r The r portion of the ECDSA sig\\n * @param s The s portion of the ECDSA sig\\n */\\n function delegateWithSignature(\\n address user,\\n address delegate,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @notice Gets a users twab context. This is a struct with their balance, next twab index, and cardinality.\\n * @param user The user for whom to fetch the TWAB context.\\n * @return The TWAB context, which includes { balance, nextTwabIndex, cardinality }\\n */\\n function getAccountDetails(address user) external view returns (TwabLib.AccountDetails memory);\\n\\n /**\\n * @notice Gets the TWAB at a specific index for a user.\\n * @param user The user for whom to fetch the TWAB.\\n * @param index The index of the TWAB to fetch.\\n * @return The TWAB, which includes the twab amount and the timestamp.\\n */\\n function getTwab(address user, uint16 index)\\n external\\n view\\n returns (ObservationLib.Observation memory);\\n\\n /**\\n * @notice Retrieves `user` TWAB balance.\\n * @param user Address of the user whose TWAB is being fetched.\\n * @param timestamp Timestamp at which we want to retrieve the TWAB balance.\\n * @return The TWAB balance at the given timestamp.\\n */\\n function getBalanceAt(address user, uint64 timestamp) external view returns (uint256);\\n\\n /**\\n * @notice Retrieves `user` TWAB balances.\\n * @param user Address of the user whose TWABs are being fetched.\\n * @param timestamps Timestamps range at which we want to retrieve the TWAB balances.\\n * @return `user` TWAB balances.\\n */\\n function getBalancesAt(address user, uint64[] calldata timestamps)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @notice Retrieves the average balance held by a user for a given time frame.\\n * @param user The user whose balance is checked.\\n * @param startTime The start time of the time frame.\\n * @param endTime The end time of the time frame.\\n * @return The average balance that the user held during the time frame.\\n */\\n function getAverageBalanceBetween(\\n address user,\\n uint64 startTime,\\n uint64 endTime\\n ) external view returns (uint256);\\n\\n /**\\n * @notice Retrieves the average balances held by a user for a given time frame.\\n * @param user The user whose balance is checked.\\n * @param startTimes The start time of the time frame.\\n * @param endTimes The end time of the time frame.\\n * @return The average balance that the user held during the time frame.\\n */\\n function getAverageBalancesBetween(\\n address user,\\n uint64[] calldata startTimes,\\n uint64[] calldata endTimes\\n ) external view returns (uint256[] memory);\\n\\n /**\\n * @notice Retrieves the total supply TWAB balance at the given timestamp.\\n * @param timestamp Timestamp at which we want to retrieve the total supply TWAB balance.\\n * @return The total supply TWAB balance at the given timestamp.\\n */\\n function getTotalSupplyAt(uint64 timestamp) external view returns (uint256);\\n\\n /**\\n * @notice Retrieves the total supply TWAB balance between the given timestamps range.\\n * @param timestamps Timestamps range at which we want to retrieve the total supply TWAB balance.\\n * @return Total supply TWAB balances.\\n */\\n function getTotalSuppliesAt(uint64[] calldata timestamps)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @notice Retrieves the average total supply balance for a set of given time frames.\\n * @param startTimes Array of start times.\\n * @param endTimes Array of end times.\\n * @return The average total supplies held during the time frame.\\n */\\n function getAverageTotalSuppliesBetween(\\n uint64[] calldata startTimes,\\n uint64[] calldata endTimes\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb9f6423a8a9c7394941cb84723b82cc66c5f815d689dc0562e612ae4d9f1cc27\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/libraries/DrawRingBufferLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"./RingBufferLib.sol\\\";\\n\\n/// @title Library for creating and managing a draw ring buffer.\\nlibrary DrawRingBufferLib {\\n /// @notice Draw buffer struct.\\n struct Buffer {\\n uint32 lastDrawId;\\n uint32 nextIndex;\\n uint32 cardinality;\\n }\\n\\n /// @notice Helper function to know if the draw ring buffer has been initialized.\\n /// @dev since draws start at 1 and are monotonically increased, we know we are uninitialized if nextIndex = 0 and lastDrawId = 0.\\n /// @param _buffer The buffer to check.\\n function isInitialized(Buffer memory _buffer) internal pure returns (bool) {\\n return !(_buffer.nextIndex == 0 && _buffer.lastDrawId == 0);\\n }\\n\\n /// @notice Push a draw to the buffer.\\n /// @param _buffer The buffer to push to.\\n /// @param _drawId The drawID to push.\\n /// @return The new buffer.\\n function push(Buffer memory _buffer, uint32 _drawId) internal pure returns (Buffer memory) {\\n require(!isInitialized(_buffer) || _drawId == _buffer.lastDrawId + 1, \\\"DRB/must-be-contig\\\");\\n\\n return\\n Buffer({\\n lastDrawId: _drawId,\\n nextIndex: uint32(RingBufferLib.nextIndex(_buffer.nextIndex, _buffer.cardinality)),\\n cardinality: _buffer.cardinality\\n });\\n }\\n\\n /// @notice Get draw ring buffer index pointer.\\n /// @param _buffer The buffer to get the `nextIndex` from.\\n /// @param _drawId The draw id to get the index for.\\n /// @return The draw ring buffer index pointer.\\n function getIndex(Buffer memory _buffer, uint32 _drawId) internal pure returns (uint32) {\\n require(isInitialized(_buffer) && _drawId <= _buffer.lastDrawId, \\\"DRB/future-draw\\\");\\n\\n uint32 indexOffset = _buffer.lastDrawId - _drawId;\\n require(indexOffset < _buffer.cardinality, \\\"DRB/expired-draw\\\");\\n\\n uint256 mostRecent = RingBufferLib.newestIndex(_buffer.nextIndex, _buffer.cardinality);\\n\\n return uint32(RingBufferLib.offset(uint32(mostRecent), indexOffset, _buffer.cardinality));\\n }\\n}\\n\",\"keccak256\":\"0xdcf6f0b0a5c176e505dcd284d1f160fcd5b4c6ba5868047935de3cd1a41fe675\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/libraries/ExtendedSafeCastLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary ExtendedSafeCastLib {\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 _value) internal pure returns (uint104) {\\n require(_value <= type(uint104).max, \\\"SafeCast: value doesn't fit in 104 bits\\\");\\n return uint104(_value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 _value) internal pure returns (uint208) {\\n require(_value <= type(uint208).max, \\\"SafeCast: value doesn't fit in 208 bits\\\");\\n return uint208(_value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 _value) internal pure returns (uint224) {\\n require(_value <= type(uint224).max, \\\"SafeCast: value doesn't fit in 224 bits\\\");\\n return uint224(_value);\\n }\\n}\\n\",\"keccak256\":\"0x1e8add7802f19dbf5957b4d921b2d7b5277f39c9e44505c0375e52f02134e434\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/libraries/ObservationLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\n\\nimport \\\"./OverflowSafeComparatorLib.sol\\\";\\nimport \\\"./RingBufferLib.sol\\\";\\n\\n/**\\n* @title Observation Library\\n* @notice This library allows one to store an array of timestamped values and efficiently binary search them.\\n* @dev Largely pulled from Uniswap V3 Oracle.sol: https://github.com/Uniswap/v3-core/blob/c05a0e2c8c08c460fb4d05cfdda30b3ad8deeaac/contracts/libraries/Oracle.sol\\n* @author PoolTogether Inc.\\n*/\\nlibrary ObservationLib {\\n using OverflowSafeComparatorLib for uint32;\\n using SafeCast for uint256;\\n\\n /// @notice The maximum number of observations\\n uint24 public constant MAX_CARDINALITY = 16777215; // 2**24\\n\\n /**\\n * @notice Observation, which includes an amount and timestamp.\\n * @param amount `amount` at `timestamp`.\\n * @param timestamp Recorded `timestamp`.\\n */\\n struct Observation {\\n uint224 amount;\\n uint32 timestamp;\\n }\\n\\n /**\\n * @notice Fetches Observations `beforeOrAt` and `atOrAfter` a `_target`, eg: where [`beforeOrAt`, `atOrAfter`] is satisfied.\\n * The result may be the same Observation, or adjacent Observations.\\n * @dev The answer must be contained in the array used when the target is located within the stored Observation.\\n * boundaries: older than the most recent Observation and younger, or the same age as, the oldest Observation.\\n * @dev If `_newestObservationIndex` is less than `_oldestObservationIndex`, it means that we've wrapped around the circular buffer.\\n * So the most recent observation will be at `_oldestObservationIndex + _cardinality - 1`, at the beginning of the circular buffer.\\n * @param _observations List of Observations to search through.\\n * @param _newestObservationIndex Index of the newest Observation. Right side of the circular buffer.\\n * @param _oldestObservationIndex Index of the oldest Observation. Left side of the circular buffer.\\n * @param _target Timestamp at which we are searching the Observation.\\n * @param _cardinality Cardinality of the circular buffer we are searching through.\\n * @param _time Timestamp at which we perform the binary search.\\n * @return beforeOrAt Observation recorded before, or at, the target.\\n * @return atOrAfter Observation recorded at, or after, the target.\\n */\\n function binarySearch(\\n Observation[MAX_CARDINALITY] storage _observations,\\n uint24 _newestObservationIndex,\\n uint24 _oldestObservationIndex,\\n uint32 _target,\\n uint24 _cardinality,\\n uint32 _time\\n ) internal view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {\\n uint256 leftSide = _oldestObservationIndex;\\n uint256 rightSide = _newestObservationIndex < leftSide\\n ? leftSide + _cardinality - 1\\n : _newestObservationIndex;\\n uint256 currentIndex;\\n\\n while (true) {\\n // We start our search in the middle of the `leftSide` and `rightSide`.\\n // After each iteration, we narrow down the search to the left or the right side while still starting our search in the middle.\\n currentIndex = (leftSide + rightSide) / 2;\\n\\n beforeOrAt = _observations[uint24(RingBufferLib.wrap(currentIndex, _cardinality))];\\n uint32 beforeOrAtTimestamp = beforeOrAt.timestamp;\\n\\n // We've landed on an uninitialized timestamp, keep searching higher (more recently).\\n if (beforeOrAtTimestamp == 0) {\\n leftSide = currentIndex + 1;\\n continue;\\n }\\n\\n atOrAfter = _observations[uint24(RingBufferLib.nextIndex(currentIndex, _cardinality))];\\n\\n bool targetAtOrAfter = beforeOrAtTimestamp.lte(_target, _time);\\n\\n // Check if we've found the corresponding Observation.\\n if (targetAtOrAfter && _target.lte(atOrAfter.timestamp, _time)) {\\n break;\\n }\\n\\n // If `beforeOrAtTimestamp` is greater than `_target`, then we keep searching lower. To the left of the current index.\\n if (!targetAtOrAfter) {\\n rightSide = currentIndex - 1;\\n } else {\\n // Otherwise, we keep searching higher. To the left of the current index.\\n leftSide = currentIndex + 1;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x225592b42013fc0af60822e75bc047d53b42a5fcf15f2173cdc3b50bea334b0a\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/libraries/OverflowSafeComparatorLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\n/// @title OverflowSafeComparatorLib library to share comparator functions between contracts\\n/// @dev Code taken from Uniswap V3 Oracle.sol: https://github.com/Uniswap/v3-core/blob/3e88af408132fc957e3e406f65a0ce2b1ca06c3d/contracts/libraries/Oracle.sol\\n/// @author PoolTogether Inc.\\nlibrary OverflowSafeComparatorLib {\\n /// @notice 32-bit timestamps comparator.\\n /// @dev safe for 0 or 1 overflows, `_a` and `_b` must be chronologically before or equal to time.\\n /// @param _a A comparison timestamp from which to determine the relative position of `_timestamp`.\\n /// @param _b Timestamp to compare against `_a`.\\n /// @param _timestamp A timestamp truncated to 32 bits.\\n /// @return bool Whether `_a` is chronologically < `_b`.\\n function lt(\\n uint32 _a,\\n uint32 _b,\\n uint32 _timestamp\\n ) internal pure returns (bool) {\\n // No need to adjust if there hasn't been an overflow\\n if (_a <= _timestamp && _b <= _timestamp) return _a < _b;\\n\\n uint256 aAdjusted = _a > _timestamp ? _a : _a + 2**32;\\n uint256 bAdjusted = _b > _timestamp ? _b : _b + 2**32;\\n\\n return aAdjusted < bAdjusted;\\n }\\n\\n /// @notice 32-bit timestamps comparator.\\n /// @dev safe for 0 or 1 overflows, `_a` and `_b` must be chronologically before or equal to time.\\n /// @param _a A comparison timestamp from which to determine the relative position of `_timestamp`.\\n /// @param _b Timestamp to compare against `_a`.\\n /// @param _timestamp A timestamp truncated to 32 bits.\\n /// @return bool Whether `_a` is chronologically <= `_b`.\\n function lte(\\n uint32 _a,\\n uint32 _b,\\n uint32 _timestamp\\n ) internal pure returns (bool) {\\n\\n // No need to adjust if there hasn't been an overflow\\n if (_a <= _timestamp && _b <= _timestamp) return _a <= _b;\\n\\n uint256 aAdjusted = _a > _timestamp ? _a : _a + 2**32;\\n uint256 bAdjusted = _b > _timestamp ? _b : _b + 2**32;\\n\\n return aAdjusted <= bAdjusted;\\n }\\n\\n /// @notice 32-bit timestamp subtractor\\n /// @dev safe for 0 or 1 overflows, where `_a` and `_b` must be chronologically before or equal to time\\n /// @param _a The subtraction left operand\\n /// @param _b The subtraction right operand\\n /// @param _timestamp The current time. Expected to be chronologically after both.\\n /// @return The difference between a and b, adjusted for overflow\\n function checkedSub(\\n uint32 _a,\\n uint32 _b,\\n uint32 _timestamp\\n ) internal pure returns (uint32) {\\n // No need to adjust if there hasn't been an overflow\\n\\n if (_a <= _timestamp && _b <= _timestamp) return _a - _b;\\n\\n uint256 aAdjusted = _a > _timestamp ? _a : _a + 2**32;\\n uint256 bAdjusted = _b > _timestamp ? _b : _b + 2**32;\\n\\n return uint32(aAdjusted - bAdjusted);\\n }\\n}\\n\",\"keccak256\":\"0x20630cf89e7b92462946defe979fd0e69fa119841d55886121948ad810778c74\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/libraries/RingBufferLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nlibrary RingBufferLib {\\n /**\\n * @notice Returns wrapped TWAB index.\\n * @dev In order to navigate the TWAB circular buffer, we need to use the modulo operator.\\n * @dev For example, if `_index` is equal to 32 and the TWAB circular buffer is of `_cardinality` 32,\\n * it will return 0 and will point to the first element of the array.\\n * @param _index Index used to navigate through the TWAB circular buffer.\\n * @param _cardinality TWAB buffer cardinality.\\n * @return TWAB index.\\n */\\n function wrap(uint256 _index, uint256 _cardinality) internal pure returns (uint256) {\\n return _index % _cardinality;\\n }\\n\\n /**\\n * @notice Computes the negative offset from the given index, wrapped by the cardinality.\\n * @dev We add `_cardinality` to `_index` to be able to offset even if `_amount` is superior to `_cardinality`.\\n * @param _index The index from which to offset\\n * @param _amount The number of indices to offset. This is subtracted from the given index.\\n * @param _cardinality The number of elements in the ring buffer\\n * @return Offsetted index.\\n */\\n function offset(\\n uint256 _index,\\n uint256 _amount,\\n uint256 _cardinality\\n ) internal pure returns (uint256) {\\n return wrap(_index + _cardinality - _amount, _cardinality);\\n }\\n\\n /// @notice Returns the index of the last recorded TWAB\\n /// @param _nextIndex The next available twab index. This will be recorded to next.\\n /// @param _cardinality The cardinality of the TWAB history.\\n /// @return The index of the last recorded TWAB\\n function newestIndex(uint256 _nextIndex, uint256 _cardinality)\\n internal\\n pure\\n returns (uint256)\\n {\\n if (_cardinality == 0) {\\n return 0;\\n }\\n\\n return wrap(_nextIndex + _cardinality - 1, _cardinality);\\n }\\n\\n /// @notice Computes the ring buffer index that follows the given one, wrapped by cardinality\\n /// @param _index The index to increment\\n /// @param _cardinality The number of elements in the Ring Buffer\\n /// @return The next index relative to the given index. Will wrap around to 0 if the next index == cardinality\\n function nextIndex(uint256 _index, uint256 _cardinality)\\n internal\\n pure\\n returns (uint256)\\n {\\n return wrap(_index + 1, _cardinality);\\n }\\n}\\n\",\"keccak256\":\"0x052e3bf6bfb30f32950e322c853589a8d153cf34f4b1ee292b17eb46f2ae656c\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/libraries/TwabLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"./ExtendedSafeCastLib.sol\\\";\\nimport \\\"./OverflowSafeComparatorLib.sol\\\";\\nimport \\\"./RingBufferLib.sol\\\";\\nimport \\\"./ObservationLib.sol\\\";\\n\\n/**\\n * @title PoolTogether V4 TwabLib (Library)\\n * @author PoolTogether Inc Team\\n * @dev Time-Weighted Average Balance Library for ERC20 tokens.\\n * @notice This TwabLib adds on-chain historical lookups to a user(s) time-weighted average balance.\\n Each user is mapped to an Account struct containing the TWAB history (ring bufffer) and\\n ring buffer parameters. Every token.transfer() creates a new TWAB checkpoint. The new TWAB\\n checkpoint is stored in the circular ring buffer, as either a new checkpoint or rewriting\\n a previous checkpoint with new parameters. The TwabLib (using existing blocktimes 1block/15sec)\\n guarantees minimum 7.4 years of search history.\\n */\\nlibrary TwabLib {\\n using OverflowSafeComparatorLib for uint32;\\n using ExtendedSafeCastLib for uint256;\\n\\n /**\\n * @notice Sets max ring buffer length in the Account.twabs Observation list.\\n As users transfer/mint/burn tickets new Observation checkpoints are\\n recorded. The current max cardinality guarantees a six month minimum,\\n of historical accurate lookups with current estimates of 1 new block\\n every 15 seconds - the of course contain a transfer to trigger an\\n observation write to storage.\\n * @dev The user Account.AccountDetails.cardinality parameter can NOT exceed\\n the max cardinality variable. Preventing \\\"corrupted\\\" ring buffer lookup\\n pointers and new observation checkpoints.\\n\\n The MAX_CARDINALITY in fact guarantees at least 7.4 years of records:\\n If 14 = block time in seconds\\n (2**24) * 14 = 234881024 seconds of history\\n 234881024 / (365 * 24 * 60 * 60) ~= 7.44 years\\n */\\n uint24 public constant MAX_CARDINALITY = 16777215; // 2**24\\n\\n /** @notice Struct ring buffer parameters for single user Account\\n * @param balance Current balance for an Account\\n * @param nextTwabIndex Next uninitialized or updatable ring buffer checkpoint storage slot\\n * @param cardinality Current total \\\"initialized\\\" ring buffer checkpoints for single user AccountDetails.\\n Used to set initial boundary conditions for an efficient binary search.\\n */\\n struct AccountDetails {\\n uint208 balance;\\n uint24 nextTwabIndex;\\n uint24 cardinality;\\n }\\n\\n /// @notice Combines account details with their twab history\\n /// @param details The account details\\n /// @param twabs The history of twabs for this account\\n struct Account {\\n AccountDetails details;\\n ObservationLib.Observation[MAX_CARDINALITY] twabs;\\n }\\n\\n /// @notice Increases an account's balance and records a new twab.\\n /// @param _account The account whose balance will be increased\\n /// @param _amount The amount to increase the balance by\\n /// @param _currentTime The current time\\n /// @return accountDetails The new AccountDetails\\n /// @return twab The user's latest TWAB\\n /// @return isNew Whether the TWAB is new\\n function increaseBalance(\\n Account storage _account,\\n uint208 _amount,\\n uint32 _currentTime\\n )\\n internal\\n returns (\\n AccountDetails memory accountDetails,\\n ObservationLib.Observation memory twab,\\n bool isNew\\n )\\n {\\n AccountDetails memory _accountDetails = _account.details;\\n (accountDetails, twab, isNew) = _nextTwab(_account.twabs, _accountDetails, _currentTime);\\n accountDetails.balance = _accountDetails.balance + _amount;\\n }\\n\\n /** @notice Calculates the next TWAB checkpoint for an account with a decreasing balance.\\n * @dev With Account struct and amount decreasing calculates the next TWAB observable checkpoint.\\n * @param _account Account whose balance will be decreased\\n * @param _amount Amount to decrease the balance by\\n * @param _revertMessage Revert message for insufficient balance\\n * @return accountDetails Updated Account.details struct\\n * @return twab TWAB observation (with decreasing average)\\n * @return isNew Whether TWAB is new or calling twice in the same block\\n */\\n function decreaseBalance(\\n Account storage _account,\\n uint208 _amount,\\n string memory _revertMessage,\\n uint32 _currentTime\\n )\\n internal\\n returns (\\n AccountDetails memory accountDetails,\\n ObservationLib.Observation memory twab,\\n bool isNew\\n )\\n {\\n AccountDetails memory _accountDetails = _account.details;\\n\\n require(_accountDetails.balance >= _amount, _revertMessage);\\n\\n (accountDetails, twab, isNew) = _nextTwab(_account.twabs, _accountDetails, _currentTime);\\n unchecked {\\n accountDetails.balance -= _amount;\\n }\\n }\\n\\n /** @notice Calculates the average balance held by a user for a given time frame.\\n * @dev Finds the average balance between start and end timestamp epochs.\\n Validates the supplied end time is within the range of elapsed time i.e. less then timestamp of now.\\n * @param _twabs Individual user Observation recorded checkpoints passed as storage pointer\\n * @param _accountDetails User AccountDetails struct loaded in memory\\n * @param _startTime Start of timestamp range as an epoch\\n * @param _endTime End of timestamp range as an epoch\\n * @param _currentTime Block.timestamp\\n * @return Average balance of user held between epoch timestamps start and end\\n */\\n function getAverageBalanceBetween(\\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n AccountDetails memory _accountDetails,\\n uint32 _startTime,\\n uint32 _endTime,\\n uint32 _currentTime\\n ) internal view returns (uint256) {\\n uint32 endTime = _endTime > _currentTime ? _currentTime : _endTime;\\n\\n return\\n _getAverageBalanceBetween(_twabs, _accountDetails, _startTime, endTime, _currentTime);\\n }\\n\\n /// @notice Retrieves the oldest TWAB\\n /// @param _twabs The storage array of twabs\\n /// @param _accountDetails The TWAB account details\\n /// @return index The index of the oldest TWAB in the twabs array\\n /// @return twab The oldest TWAB\\n function oldestTwab(\\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n AccountDetails memory _accountDetails\\n ) internal view returns (uint24 index, ObservationLib.Observation memory twab) {\\n index = _accountDetails.nextTwabIndex;\\n twab = _twabs[index];\\n\\n // If the TWAB is not initialized we go to the beginning of the TWAB circular buffer at index 0\\n if (twab.timestamp == 0) {\\n index = 0;\\n twab = _twabs[0];\\n }\\n }\\n\\n /// @notice Retrieves the newest TWAB\\n /// @param _twabs The storage array of twabs\\n /// @param _accountDetails The TWAB account details\\n /// @return index The index of the newest TWAB in the twabs array\\n /// @return twab The newest TWAB\\n function newestTwab(\\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n AccountDetails memory _accountDetails\\n ) internal view returns (uint24 index, ObservationLib.Observation memory twab) {\\n index = uint24(RingBufferLib.newestIndex(_accountDetails.nextTwabIndex, MAX_CARDINALITY));\\n twab = _twabs[index];\\n }\\n\\n /// @notice Retrieves amount at `_targetTime` timestamp\\n /// @param _twabs List of TWABs to search through.\\n /// @param _accountDetails Accounts details\\n /// @param _targetTime Timestamp at which the reserved TWAB should be for.\\n /// @return uint256 TWAB amount at `_targetTime`.\\n function getBalanceAt(\\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n AccountDetails memory _accountDetails,\\n uint32 _targetTime,\\n uint32 _currentTime\\n ) internal view returns (uint256) {\\n uint32 timeToTarget = _targetTime > _currentTime ? _currentTime : _targetTime;\\n return _getBalanceAt(_twabs, _accountDetails, timeToTarget, _currentTime);\\n }\\n\\n /// @notice Calculates the average balance held by a user for a given time frame.\\n /// @param _startTime The start time of the time frame.\\n /// @param _endTime The end time of the time frame.\\n /// @return The average balance that the user held during the time frame.\\n function _getAverageBalanceBetween(\\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n AccountDetails memory _accountDetails,\\n uint32 _startTime,\\n uint32 _endTime,\\n uint32 _currentTime\\n ) private view returns (uint256) {\\n (uint24 oldestTwabIndex, ObservationLib.Observation memory oldTwab) = oldestTwab(\\n _twabs,\\n _accountDetails\\n );\\n\\n (uint24 newestTwabIndex, ObservationLib.Observation memory newTwab) = newestTwab(\\n _twabs,\\n _accountDetails\\n );\\n\\n ObservationLib.Observation memory startTwab = _calculateTwab(\\n _twabs,\\n _accountDetails,\\n newTwab,\\n oldTwab,\\n newestTwabIndex,\\n oldestTwabIndex,\\n _startTime,\\n _currentTime\\n );\\n\\n ObservationLib.Observation memory endTwab = _calculateTwab(\\n _twabs,\\n _accountDetails,\\n newTwab,\\n oldTwab,\\n newestTwabIndex,\\n oldestTwabIndex,\\n _endTime,\\n _currentTime\\n );\\n\\n // Difference in amount / time\\n return (endTwab.amount - startTwab.amount) / OverflowSafeComparatorLib.checkedSub(endTwab.timestamp, startTwab.timestamp, _currentTime);\\n }\\n\\n /** @notice Searches TWAB history and calculate the difference between amount(s)/timestamp(s) to return average balance\\n between the Observations closes to the supplied targetTime.\\n * @param _twabs Individual user Observation recorded checkpoints passed as storage pointer\\n * @param _accountDetails User AccountDetails struct loaded in memory\\n * @param _targetTime Target timestamp to filter Observations in the ring buffer binary search\\n * @param _currentTime Block.timestamp\\n * @return uint256 Time-weighted average amount between two closest observations.\\n */\\n function _getBalanceAt(\\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n AccountDetails memory _accountDetails,\\n uint32 _targetTime,\\n uint32 _currentTime\\n ) private view returns (uint256) {\\n uint24 newestTwabIndex;\\n ObservationLib.Observation memory afterOrAt;\\n ObservationLib.Observation memory beforeOrAt;\\n (newestTwabIndex, beforeOrAt) = newestTwab(_twabs, _accountDetails);\\n\\n // If `_targetTime` is chronologically after the newest TWAB, we can simply return the current balance\\n if (beforeOrAt.timestamp.lte(_targetTime, _currentTime)) {\\n return _accountDetails.balance;\\n }\\n\\n uint24 oldestTwabIndex;\\n // Now, set before to the oldest TWAB\\n (oldestTwabIndex, beforeOrAt) = oldestTwab(_twabs, _accountDetails);\\n\\n // If `_targetTime` is chronologically before the oldest TWAB, we can early return\\n if (_targetTime.lt(beforeOrAt.timestamp, _currentTime)) {\\n return 0;\\n }\\n\\n // Otherwise, we perform the `binarySearch`\\n (beforeOrAt, afterOrAt) = ObservationLib.binarySearch(\\n _twabs,\\n newestTwabIndex,\\n oldestTwabIndex,\\n _targetTime,\\n _accountDetails.cardinality,\\n _currentTime\\n );\\n\\n // Sum the difference in amounts and divide by the difference in timestamps.\\n // The time-weighted average balance uses time measured between two epoch timestamps as\\n // a constaint on the measurement when calculating the time weighted average balance.\\n return\\n (afterOrAt.amount - beforeOrAt.amount) / OverflowSafeComparatorLib.checkedSub(afterOrAt.timestamp, beforeOrAt.timestamp, _currentTime);\\n }\\n\\n /** @notice Calculates a user TWAB for a target timestamp using the historical TWAB records.\\n The balance is linearly interpolated: amount differences / timestamp differences\\n using the simple (after.amount - before.amount / end.timestamp - start.timestamp) formula.\\n /** @dev Binary search in _calculateTwab fails when searching out of bounds. Thus, before\\n searching we exclude target timestamps out of range of newest/oldest TWAB(s).\\n IF a search is before or after the range we \\\"extrapolate\\\" a Observation from the expected state.\\n * @param _twabs Individual user Observation recorded checkpoints passed as storage pointer\\n * @param _accountDetails User AccountDetails struct loaded in memory\\n * @param _newestTwab Newest TWAB in history (end of ring buffer)\\n * @param _oldestTwab Olderst TWAB in history (end of ring buffer)\\n * @param _newestTwabIndex Pointer in ring buffer to newest TWAB\\n * @param _oldestTwabIndex Pointer in ring buffer to oldest TWAB\\n * @param _targetTimestamp Epoch timestamp to calculate for time (T) in the TWAB\\n * @param _time Block.timestamp\\n * @return accountDetails Updated Account.details struct\\n */\\n function _calculateTwab(\\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n AccountDetails memory _accountDetails,\\n ObservationLib.Observation memory _newestTwab,\\n ObservationLib.Observation memory _oldestTwab,\\n uint24 _newestTwabIndex,\\n uint24 _oldestTwabIndex,\\n uint32 _targetTimestamp,\\n uint32 _time\\n ) private view returns (ObservationLib.Observation memory) {\\n // If `_targetTimestamp` is chronologically after the newest TWAB, we extrapolate a new one\\n if (_newestTwab.timestamp.lt(_targetTimestamp, _time)) {\\n return _computeNextTwab(_newestTwab, _accountDetails.balance, _targetTimestamp);\\n }\\n\\n if (_newestTwab.timestamp == _targetTimestamp) {\\n return _newestTwab;\\n }\\n\\n if (_oldestTwab.timestamp == _targetTimestamp) {\\n return _oldestTwab;\\n }\\n\\n // If `_targetTimestamp` is chronologically before the oldest TWAB, we create a zero twab\\n if (_targetTimestamp.lt(_oldestTwab.timestamp, _time)) {\\n return ObservationLib.Observation({ amount: 0, timestamp: _targetTimestamp });\\n }\\n\\n // Otherwise, both timestamps must be surrounded by twabs.\\n (\\n ObservationLib.Observation memory beforeOrAtStart,\\n ObservationLib.Observation memory afterOrAtStart\\n ) = ObservationLib.binarySearch(\\n _twabs,\\n _newestTwabIndex,\\n _oldestTwabIndex,\\n _targetTimestamp,\\n _accountDetails.cardinality,\\n _time\\n );\\n\\n uint224 heldBalance = (afterOrAtStart.amount - beforeOrAtStart.amount) /\\n OverflowSafeComparatorLib.checkedSub(afterOrAtStart.timestamp, beforeOrAtStart.timestamp, _time);\\n\\n return _computeNextTwab(beforeOrAtStart, heldBalance, _targetTimestamp);\\n }\\n\\n /**\\n * @notice Calculates the next TWAB using the newestTwab and updated balance.\\n * @dev Storage of the TWAB obersation is managed by the calling function and not _computeNextTwab.\\n * @param _currentTwab Newest Observation in the Account.twabs list\\n * @param _currentBalance User balance at time of most recent (newest) checkpoint write\\n * @param _time Current block.timestamp\\n * @return TWAB Observation\\n */\\n function _computeNextTwab(\\n ObservationLib.Observation memory _currentTwab,\\n uint224 _currentBalance,\\n uint32 _time\\n ) private pure returns (ObservationLib.Observation memory) {\\n // New twab amount = last twab amount (or zero) + (current amount * elapsed seconds)\\n return\\n ObservationLib.Observation({\\n amount: _currentTwab.amount +\\n _currentBalance *\\n (_time.checkedSub(_currentTwab.timestamp, _time)),\\n timestamp: _time\\n });\\n }\\n\\n /// @notice Sets a new TWAB Observation at the next available index and returns the new account details.\\n /// @dev Note that if _currentTime is before the last observation timestamp, it appears as an overflow\\n /// @param _twabs The twabs array to insert into\\n /// @param _accountDetails The current account details\\n /// @param _currentTime The current time\\n /// @return accountDetails The new account details\\n /// @return twab The newest twab (may or may not be brand-new)\\n /// @return isNew Whether the newest twab was created by this call\\n function _nextTwab(\\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\\n AccountDetails memory _accountDetails,\\n uint32 _currentTime\\n )\\n private\\n returns (\\n AccountDetails memory accountDetails,\\n ObservationLib.Observation memory twab,\\n bool isNew\\n )\\n {\\n (, ObservationLib.Observation memory _newestTwab) = newestTwab(_twabs, _accountDetails);\\n\\n // if we're in the same block, return\\n if (_newestTwab.timestamp == _currentTime) {\\n return (_accountDetails, _newestTwab, false);\\n }\\n\\n ObservationLib.Observation memory newTwab = _computeNextTwab(\\n _newestTwab,\\n _accountDetails.balance,\\n _currentTime\\n );\\n\\n _twabs[_accountDetails.nextTwabIndex] = newTwab;\\n\\n AccountDetails memory nextAccountDetails = push(_accountDetails);\\n\\n return (nextAccountDetails, newTwab, true);\\n }\\n\\n /// @notice \\\"Pushes\\\" a new element on the AccountDetails ring buffer, and returns the new AccountDetails\\n /// @param _accountDetails The account details from which to pull the cardinality and next index\\n /// @return The new AccountDetails\\n function push(AccountDetails memory _accountDetails)\\n internal\\n pure\\n returns (AccountDetails memory)\\n {\\n _accountDetails.nextTwabIndex = uint24(\\n RingBufferLib.nextIndex(_accountDetails.nextTwabIndex, MAX_CARDINALITY)\\n );\\n\\n // Prevent the Account specific cardinality from exceeding the MAX_CARDINALITY.\\n // The ring buffer length is limited by MAX_CARDINALITY. IF the account.cardinality\\n // exceeds the max cardinality, new observations would be incorrectly set or the\\n // observation would be out of \\\"bounds\\\" of the ring buffer. Once reached the\\n // AccountDetails.cardinality will continue to be equal to max cardinality.\\n if (_accountDetails.cardinality < MAX_CARDINALITY) {\\n _accountDetails.cardinality += 1;\\n }\\n\\n return _accountDetails;\\n }\\n}\\n\",\"keccak256\":\"0xa9cd1103707325d2eaba038d7c0f2b271d934448b8782b82f922653eccb8c90a\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-timelocks/contracts/BeaconTimelockTrigger.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.6;\\nimport \\\"@pooltogether/v4-core/contracts/interfaces/IDrawBeacon.sol\\\";\\nimport \\\"@pooltogether/v4-core/contracts/interfaces/IDrawBuffer.sol\\\";\\nimport \\\"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\\\";\\nimport \\\"./interfaces/IBeaconTimelockTrigger.sol\\\";\\nimport \\\"./interfaces/IPrizeDistributionFactory.sol\\\";\\nimport \\\"./interfaces/IDrawCalculatorTimelock.sol\\\";\\n\\n/**\\n * @title PoolTogether V4 BeaconTimelockTrigger\\n * @author PoolTogether Inc Team\\n * @notice The BeaconTimelockTrigger smart contract is an upgrade of the L1TimelockTimelock smart contract.\\n Reducing protocol risk by eliminating off-chain computation of PrizeDistribution parameters. The timelock will\\n only pass the total supply of all tickets in a \\\"PrizePool Network\\\" to the prize distribution factory contract.\\n*/\\ncontract BeaconTimelockTrigger is IBeaconTimelockTrigger, Manageable {\\n /* ============ Global Variables ============ */\\n\\n /// @notice PrizeDistributionFactory reference.\\n IPrizeDistributionFactory public immutable prizeDistributionFactory;\\n\\n /// @notice DrawCalculatorTimelock reference.\\n IDrawCalculatorTimelock public immutable timelock;\\n\\n /* ============ Constructor ============ */\\n\\n /**\\n * @notice Initialize BeaconTimelockTrigger smart contract.\\n * @param _owner The smart contract owner\\n * @param _prizeDistributionFactory PrizeDistributionFactory address\\n * @param _timelock DrawCalculatorTimelock address\\n */\\n constructor(\\n address _owner,\\n IPrizeDistributionFactory _prizeDistributionFactory,\\n IDrawCalculatorTimelock _timelock\\n ) Ownable(_owner) {\\n prizeDistributionFactory = _prizeDistributionFactory;\\n timelock = _timelock;\\n emit Deployed(_prizeDistributionFactory, _timelock);\\n }\\n\\n /// @inheritdoc IBeaconTimelockTrigger\\n function push(IDrawBeacon.Draw memory _draw, uint256 _totalNetworkTicketSupply)\\n external\\n override\\n onlyManagerOrOwner\\n {\\n timelock.lock(_draw.drawId, _draw.timestamp + _draw.beaconPeriodSeconds);\\n prizeDistributionFactory.pushPrizeDistribution(_draw.drawId, _totalNetworkTicketSupply);\\n emit DrawLockedAndTotalNetworkTicketSupplyPushed(\\n _draw.drawId,\\n _draw,\\n _totalNetworkTicketSupply\\n );\\n }\\n}\\n\",\"keccak256\":\"0x4efbca883d0e8b28079b13bd4882e9b4ad452ef55fd5d4ba98251b81662712d5\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-timelocks/contracts/interfaces/IBeaconTimelockTrigger.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.6;\\nimport \\\"@pooltogether/v4-core/contracts/interfaces/IDrawBeacon.sol\\\";\\nimport \\\"./IPrizeDistributionFactory.sol\\\";\\nimport \\\"./IDrawCalculatorTimelock.sol\\\";\\n\\n/**\\n * @title PoolTogether V4 IBeaconTimelockTrigger\\n * @author PoolTogether Inc Team\\n * @notice The IBeaconTimelockTrigger smart contract interface...\\n */\\ninterface IBeaconTimelockTrigger {\\n /// @notice Emitted when the contract is deployed.\\n event Deployed(\\n IPrizeDistributionFactory indexed prizeDistributionFactory,\\n IDrawCalculatorTimelock indexed timelock\\n );\\n\\n /**\\n * @notice Emitted when Draw is locked and totalNetworkTicketSupply is pushed to PrizeDistributionFactory\\n * @param drawId Draw ID\\n * @param draw Draw\\n * @param totalNetworkTicketSupply totalNetworkTicketSupply\\n */\\n event DrawLockedAndTotalNetworkTicketSupplyPushed(\\n uint32 indexed drawId,\\n IDrawBeacon.Draw draw,\\n uint256 totalNetworkTicketSupply\\n );\\n\\n /**\\n * @notice Locks next Draw and pushes totalNetworkTicketSupply to PrizeDistributionFactory\\n * @dev Restricts new draws for N seconds by forcing timelock on the next target draw id.\\n * @param draw Draw\\n * @param totalNetworkTicketSupply totalNetworkTicketSupply\\n */\\n function push(IDrawBeacon.Draw memory draw, uint256 totalNetworkTicketSupply) external;\\n}\\n\",\"keccak256\":\"0x729afb3ec0681df30f6f6884fbcf8485df319db514e5f3e5bbacf36b6e4d5c4d\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-timelocks/contracts/interfaces/IDrawCalculatorTimelock.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@pooltogether/v4-core/contracts/interfaces/IDrawCalculator.sol\\\";\\n\\ninterface IDrawCalculatorTimelock {\\n /**\\n * @notice Emitted when target draw id is locked.\\n * @param timestamp The epoch timestamp to unlock the current locked Draw\\n * @param drawId The Draw to unlock\\n */\\n struct Timelock {\\n uint64 timestamp;\\n uint32 drawId;\\n }\\n\\n /**\\n * @notice Emitted when target draw id is locked.\\n * @param drawId Draw ID\\n * @param timestamp Block timestamp\\n */\\n event LockedDraw(uint32 indexed drawId, uint64 timestamp);\\n\\n /**\\n * @notice Emitted event when the timelock struct is updated\\n * @param timelock Timelock struct set\\n */\\n event TimelockSet(Timelock timelock);\\n\\n /**\\n * @notice Routes claim/calculate requests between PrizeDistributor and DrawCalculator.\\n * @dev Will enforce a \\\"cooldown\\\" period between when a Draw is pushed and when users can start to claim prizes.\\n * @param user User address\\n * @param drawIds Draw.drawId\\n * @param data Encoded pick indices\\n * @return Prizes awardable array\\n */\\n function calculate(\\n address user,\\n uint32[] calldata drawIds,\\n bytes calldata data\\n ) external view returns (uint256[] memory, bytes memory);\\n\\n /**\\n * @notice Lock passed draw id for `timelockDuration` seconds.\\n * @dev Restricts new draws by forcing a push timelock.\\n * @param _drawId Draw id to lock.\\n * @param _timestamp Epoch timestamp to unlock the draw.\\n * @return True if operation was successful.\\n */\\n function lock(uint32 _drawId, uint64 _timestamp) external returns (bool);\\n\\n /**\\n * @notice Read internal DrawCalculator variable.\\n * @return IDrawCalculator\\n */\\n function getDrawCalculator() external view returns (IDrawCalculator);\\n\\n /**\\n * @notice Read internal Timelock struct.\\n * @return Timelock\\n */\\n function getTimelock() external view returns (Timelock memory);\\n\\n /**\\n * @notice Set the Timelock struct. Only callable by the contract owner.\\n * @param _timelock Timelock struct to set.\\n */\\n function setTimelock(Timelock memory _timelock) external;\\n\\n /**\\n * @notice Returns bool for timelockDuration elapsing.\\n * @return True if timelockDuration, since last timelock has elapsed, false otherwise.\\n */\\n function hasElapsed() external view returns (bool);\\n}\\n\",\"keccak256\":\"0x86cb0ce3c4d14456968c78c7ee3ac667ee5acc208d5d66e5b93f426ae5e241e7\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-timelocks/contracts/interfaces/IPrizeDistributionFactory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity 0.8.6;\\n\\ninterface IPrizeDistributionFactory {\\n function pushPrizeDistribution(uint32 _drawId, uint256 _totalNetworkTicketSupply) external;\\n}\\n\",\"keccak256\":\"0x035644792635f46d3ce9878f2e6e19ce4b9c7eaafde336222ffb45889ff18e5d\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x60c060405234801561001057600080fd5b50604051610bdc380380610bdc83398101604081905261002f916100e5565b8261003981610095565b506001600160601b0319606083811b821660805282901b1660a0526040516001600160a01b0382811691908416907f09e48df7857bd0c1e0d31bb8a85d42cf1874817895f171c917f6ee2cea73ec2090600090a350505061014a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000606084860312156100fa57600080fd5b835161010581610132565b602085015190935061011681610132565b604085015190925061012781610132565b809150509250925092565b6001600160a01b038116811461014757600080fd5b50565b60805160601c60a05160601c610a5961018360003960008181610172015261037501526000818161010401526104a10152610a596000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c8063a913c9da11610076578063d33219b41161005b578063d33219b41461016d578063e30c397814610194578063f2fde38b146101a557600080fd5b8063a913c9da14610137578063d0ebdbe71461014a57600080fd5b8063715018a6116100a7578063715018a6146100f757806378e072a9146100ff5780638da5cb5b1461012657600080fd5b8063481c6a75146100c35780634e71e0c8146100ed575b600080fd5b6002546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100f56101b8565b005b6100f561024b565b6100d07f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b03166100d0565b6100f561014536600461090a565b6102c0565b61015d6101583660046108b8565b61058b565b60405190151581526020016100e4565b6100d07f000000000000000000000000000000000000000000000000000000000000000081565b6001546001600160a01b03166100d0565b6100f56101b33660046108b8565b610607565b6001546001600160a01b031633146102175760405162461bcd60e51b815260206004820152601f60248201527f4f776e61626c652f63616c6c65722d6e6f742d70656e64696e674f776e65720060448201526064015b60405180910390fd5b60015461022c906001600160a01b0316610743565b6001805473ffffffffffffffffffffffffffffffffffffffff19169055565b3361025e6000546001600160a01b031690565b6001600160a01b0316146102b45760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161020e565b6102be6000610743565b565b336102d36002546001600160a01b031690565b6001600160a01b031614806103015750336102f66000546001600160a01b031690565b6001600160a01b0316145b6103735760405162461bcd60e51b815260206004820152602660248201527f4d616e61676561626c652f63616c6c65722d6e6f742d6d616e616765722d6f7260448201527f2d6f776e65720000000000000000000000000000000000000000000000000000606482015260840161020e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638871189b8360200151846080015163ffffffff1685604001516103c191906109d0565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815263ffffffff92909216600483015267ffffffffffffffff166024820152604401602060405180830381600087803b15801561042757600080fd5b505af115801561043b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045f91906108e8565b5060208201516040517f0348b07600000000000000000000000000000000000000000000000000000000815263ffffffff9091166004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690630348b07690604401600060405180830381600087803b1580156104ed57600080fd5b505af1158015610501573d6000803e3d6000fd5b50505050602082810180516040805186518152925163ffffffff908116948401949094528086015167ffffffffffffffff908116848301526060808801519091169084015260808087015185169084015260a08301859052519216917fedb65adbca0b9daa2f70fb5e43a2119fdc09136b9552987e6e82ac54b9131dfa9181900360c00190a25050565b6000336105a06000546001600160a01b031690565b6001600160a01b0316146105f65760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161020e565b6105ff826107a0565b90505b919050565b3361061a6000546001600160a01b031690565b6001600160a01b0316146106705760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161020e565b6001600160a01b0381166106ec5760405162461bcd60e51b815260206004820152602560248201527f4f776e61626c652f70656e64696e674f776e65722d6e6f742d7a65726f2d616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161020e565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f239a2ddded15777fa246aed5f7e1a9bc69a39d4eb4a397034d1d85766cca7d4c90600090a250565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6002546000906001600160a01b039081169083168114156108295760405162461bcd60e51b815260206004820152602360248201527f4d616e61676561626c652f6578697374696e672d6d616e616765722d6164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161020e565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385811691821790925560405190918316907f9cb45c728de594dab506a1f1a8554e24c8eeaf983618d5ec5dd7bc6f3c49feee90600090a350600192915050565b803563ffffffff8116811461060257600080fd5b803567ffffffffffffffff8116811461060257600080fd5b6000602082840312156108ca57600080fd5b81356001600160a01b03811681146108e157600080fd5b9392505050565b6000602082840312156108fa57600080fd5b815180151581146108e157600080fd5b60008082840360c081121561091e57600080fd5b60a081121561092c57600080fd5b5060405160a0810181811067ffffffffffffffff82111715610977577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040528335815261098a6020850161088c565b602082015261099b604085016108a0565b60408201526109ac606085016108a0565b60608201526109bd6080850161088c565b60808201529460a0939093013593505050565b600067ffffffffffffffff808316818516808303821115610a1a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b0194935050505056fea26469706673582212200b7204db3375fa36199a2db2cbc3af24ff18d4d6b4c9a3852a381087e796617364736f6c63430008060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100be5760003560e01c8063a913c9da11610076578063d33219b41161005b578063d33219b41461016d578063e30c397814610194578063f2fde38b146101a557600080fd5b8063a913c9da14610137578063d0ebdbe71461014a57600080fd5b8063715018a6116100a7578063715018a6146100f757806378e072a9146100ff5780638da5cb5b1461012657600080fd5b8063481c6a75146100c35780634e71e0c8146100ed575b600080fd5b6002546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100f56101b8565b005b6100f561024b565b6100d07f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b03166100d0565b6100f561014536600461090a565b6102c0565b61015d6101583660046108b8565b61058b565b60405190151581526020016100e4565b6100d07f000000000000000000000000000000000000000000000000000000000000000081565b6001546001600160a01b03166100d0565b6100f56101b33660046108b8565b610607565b6001546001600160a01b031633146102175760405162461bcd60e51b815260206004820152601f60248201527f4f776e61626c652f63616c6c65722d6e6f742d70656e64696e674f776e65720060448201526064015b60405180910390fd5b60015461022c906001600160a01b0316610743565b6001805473ffffffffffffffffffffffffffffffffffffffff19169055565b3361025e6000546001600160a01b031690565b6001600160a01b0316146102b45760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161020e565b6102be6000610743565b565b336102d36002546001600160a01b031690565b6001600160a01b031614806103015750336102f66000546001600160a01b031690565b6001600160a01b0316145b6103735760405162461bcd60e51b815260206004820152602660248201527f4d616e61676561626c652f63616c6c65722d6e6f742d6d616e616765722d6f7260448201527f2d6f776e65720000000000000000000000000000000000000000000000000000606482015260840161020e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638871189b8360200151846080015163ffffffff1685604001516103c191906109d0565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815263ffffffff92909216600483015267ffffffffffffffff166024820152604401602060405180830381600087803b15801561042757600080fd5b505af115801561043b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045f91906108e8565b5060208201516040517f0348b07600000000000000000000000000000000000000000000000000000000815263ffffffff9091166004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690630348b07690604401600060405180830381600087803b1580156104ed57600080fd5b505af1158015610501573d6000803e3d6000fd5b50505050602082810180516040805186518152925163ffffffff908116948401949094528086015167ffffffffffffffff908116848301526060808801519091169084015260808087015185169084015260a08301859052519216917fedb65adbca0b9daa2f70fb5e43a2119fdc09136b9552987e6e82ac54b9131dfa9181900360c00190a25050565b6000336105a06000546001600160a01b031690565b6001600160a01b0316146105f65760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161020e565b6105ff826107a0565b90505b919050565b3361061a6000546001600160a01b031690565b6001600160a01b0316146106705760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161020e565b6001600160a01b0381166106ec5760405162461bcd60e51b815260206004820152602560248201527f4f776e61626c652f70656e64696e674f776e65722d6e6f742d7a65726f2d616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161020e565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f239a2ddded15777fa246aed5f7e1a9bc69a39d4eb4a397034d1d85766cca7d4c90600090a250565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6002546000906001600160a01b039081169083168114156108295760405162461bcd60e51b815260206004820152602360248201527f4d616e61676561626c652f6578697374696e672d6d616e616765722d6164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161020e565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385811691821790925560405190918316907f9cb45c728de594dab506a1f1a8554e24c8eeaf983618d5ec5dd7bc6f3c49feee90600090a350600192915050565b803563ffffffff8116811461060257600080fd5b803567ffffffffffffffff8116811461060257600080fd5b6000602082840312156108ca57600080fd5b81356001600160a01b03811681146108e157600080fd5b9392505050565b6000602082840312156108fa57600080fd5b815180151581146108e157600080fd5b60008082840360c081121561091e57600080fd5b60a081121561092c57600080fd5b5060405160a0810181811067ffffffffffffffff82111715610977577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040528335815261098a6020850161088c565b602082015261099b604085016108a0565b60408201526109ac606085016108a0565b60608201526109bd6080850161088c565b60808201529460a0939093013593505050565b600067ffffffffffffffff808316818516808303821115610a1a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b0194935050505056fea26469706673582212200b7204db3375fa36199a2db2cbc3af24ff18d4d6b4c9a3852a381087e796617364736f6c63430008060033", + "devdoc": { + "author": "PoolTogether Inc Team", + "kind": "dev", + "methods": { + "claimOwnership()": { + "details": "This function is only callable by the `_pendingOwner`." + }, + "constructor": { + "params": { + "_owner": "The smart contract owner", + "_prizeDistributionFactory": "PrizeDistributionFactory address", + "_timelock": "DrawCalculatorTimelock address" + } + }, + "manager()": { + "returns": { + "_0": "Current `_manager` address." + } + }, + "pendingOwner()": { + "returns": { + "_0": "Current `_pendingOwner` address." + } + }, + "push((uint256,uint32,uint64,uint64,uint32),uint256)": { + "details": "Restricts new draws for N seconds by forcing timelock on the next target draw id.", + "params": { + "draw": "Draw", + "totalNetworkTicketSupply": "totalNetworkTicketSupply" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setManager(address)": { + "details": "Throws if called by any account other than the owner.", + "params": { + "_newManager": "New _manager address." + }, + "returns": { + "_0": "Boolean to indicate if the operation was successful or not." + } + }, + "transferOwnership(address)": { + "params": { + "_newOwner": "Address to transfer ownership to." + } + } + }, + "title": "PoolTogether V4 BeaconTimelockTrigger", + "version": 1 + }, + "userdoc": { + "events": { + "Deployed(address,address)": { + "notice": "Emitted when the contract is deployed." + }, + "DrawLockedAndTotalNetworkTicketSupplyPushed(uint32,(uint256,uint32,uint64,uint64,uint32),uint256)": { + "notice": "Emitted when Draw is locked and totalNetworkTicketSupply is pushed to PrizeDistributionFactory" + } + }, + "kind": "user", + "methods": { + "claimOwnership()": { + "notice": "Allows the `_pendingOwner` address to finalize the transfer." + }, + "constructor": { + "notice": "Initialize BeaconTimelockTrigger smart contract." + }, + "manager()": { + "notice": "Gets current `_manager`." + }, + "owner()": { + "notice": "Returns the address of the current owner." + }, + "pendingOwner()": { + "notice": "Gets current `_pendingOwner`." + }, + "prizeDistributionFactory()": { + "notice": "PrizeDistributionFactory reference." + }, + "push((uint256,uint32,uint64,uint64,uint32),uint256)": { + "notice": "Locks next Draw and pushes totalNetworkTicketSupply to PrizeDistributionFactory" + }, + "renounceOwnership()": { + "notice": "Renounce ownership of the contract." + }, + "setManager(address)": { + "notice": "Set or change of manager." + }, + "timelock()": { + "notice": "DrawCalculatorTimelock reference." + }, + "transferOwnership(address)": { + "notice": "Allows current owner to set the `_pendingOwner` address." + } + }, + "notice": "The BeaconTimelockTrigger smart contract is an upgrade of the L1TimelockTimelock smart contract. Reducing protocol risk by eliminating off-chain computation of PrizeDistribution parameters. The timelock will only pass the total supply of all tickets in a \"PrizePool Network\" to the prize distribution factory contract.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 5205, + "contract": "@pooltogether/v4-timelocks/contracts/BeaconTimelockTrigger.sol:BeaconTimelockTrigger", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 5207, + "contract": "@pooltogether/v4-timelocks/contracts/BeaconTimelockTrigger.sol:BeaconTimelockTrigger", + "label": "_pendingOwner", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 5103, + "contract": "@pooltogether/v4-timelocks/contracts/BeaconTimelockTrigger.sol:BeaconTimelockTrigger", + "label": "_manager", + "offset": 0, + "slot": "2", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} \ No newline at end of file diff --git a/deployments/polygon/DrawBeacon.json b/deployments/polygon/DrawBeacon.json new file mode 100644 index 0000000..627b879 --- /dev/null +++ b/deployments/polygon/DrawBeacon.json @@ -0,0 +1,1105 @@ +{ + "address": "0x52325504bD35aeC31D842F62A113E9e4b665d885", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "contract IDrawBuffer", + "name": "_drawBuffer", + "type": "address" + }, + { + "internalType": "contract RNGInterface", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_nextDrawId", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "_beaconPeriodStart", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "_beaconPeriodSeconds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_rngTimeout", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "drawPeriodSeconds", + "type": "uint32" + } + ], + "name": "BeaconPeriodSecondsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "startedAt", + "type": "uint64" + } + ], + "name": "BeaconPeriodStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "nextDrawId", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "beaconPeriodStartedAt", + "type": "uint64" + } + ], + "name": "Deployed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IDrawBuffer", + "name": "newDrawBuffer", + "type": "address" + } + ], + "name": "DrawBufferUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "rngRequestId", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "rngLockBlock", + "type": "uint32" + } + ], + "name": "DrawCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "randomNumber", + "type": "uint256" + } + ], + "name": "DrawCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "rngRequestId", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "rngLockBlock", + "type": "uint32" + } + ], + "name": "DrawStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "pendingOwner", + "type": "address" + } + ], + "name": "OwnershipOffered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract RNGInterface", + "name": "rngService", + "type": "address" + } + ], + "name": "RngServiceUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "rngTimeout", + "type": "uint32" + } + ], + "name": "RngTimeoutSet", + "type": "event" + }, + { + "inputs": [], + "name": "beaconPeriodEndAt", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beaconPeriodRemainingSeconds", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_time", + "type": "uint64" + } + ], + "name": "calculateNextBeaconPeriodStartTime", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "calculateNextBeaconPeriodStartTimeFromCurrentTime", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "canCompleteDraw", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "canStartDraw", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelDraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "claimOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "completeDraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getBeaconPeriodSeconds", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBeaconPeriodStartedAt", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDrawBuffer", + "outputs": [ + { + "internalType": "contract IDrawBuffer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastRngLockBlock", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastRngRequestId", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNextDrawId", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRngService", + "outputs": [ + { + "internalType": "contract RNGInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRngTimeout", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isBeaconPeriodOver", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRngCompleted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRngRequested", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRngTimedOut", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_beaconPeriodSeconds", + "type": "uint32" + } + ], + "name": "setBeaconPeriodSeconds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IDrawBuffer", + "name": "newDrawBuffer", + "type": "address" + } + ], + "name": "setDrawBuffer", + "outputs": [ + { + "internalType": "contract IDrawBuffer", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract RNGInterface", + "name": "_rngService", + "type": "address" + } + ], + "name": "setRngService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_rngTimeout", + "type": "uint32" + } + ], + "name": "setRngTimeout", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "startDraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x87729b9d78006af78452c4c341370864bc6b8b430c2e58515f2755bff96b1e89", + "receipt": { + "to": null, + "from": "0x4D40eb12430A57965cEe3015348d490C6156dF20", + "contractAddress": "0x52325504bD35aeC31D842F62A113E9e4b665d885", + "transactionIndex": 25, + "gasUsed": "1810385", + "logsBloom": "0x00001000000000000001000000004000000000000000000000800000000002000000020000001000000000004040000000048000000000000000040004000000000000000000400000000000000000800001000000000000000110020000000000000000020404000000000000000800000000000000000084000000000010400000000100000002000000000000000000002000000000000000000000000000200400000000000000000000000000000000000040000000000000080000004000009000800008000401000000000000000000000000000000100000400020000000000000000000000000000100000000000000000000010800000021100100", + "blockHash": "0x900b45cebe66522d3fb8044dd0005358c83df8c4d3ba516b6ec29c90a0c8e67c", + "transactionHash": "0x87729b9d78006af78452c4c341370864bc6b8b430c2e58515f2755bff96b1e89", + "logs": [ + { + "transactionIndex": 25, + "blockNumber": 36229431, + "transactionHash": "0x87729b9d78006af78452c4c341370864bc6b8b430c2e58515f2755bff96b1e89", + "address": "0x52325504bD35aeC31D842F62A113E9e4b665d885", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004d40eb12430a57965cee3015348d490c6156df20" + ], + "data": "0x", + "logIndex": 75, + "blockHash": "0x900b45cebe66522d3fb8044dd0005358c83df8c4d3ba516b6ec29c90a0c8e67c" + }, + { + "transactionIndex": 25, + "blockNumber": 36229431, + "transactionHash": "0x87729b9d78006af78452c4c341370864bc6b8b430c2e58515f2755bff96b1e89", + "address": "0x52325504bD35aeC31D842F62A113E9e4b665d885", + "topics": [ + "0x4727494dbd863e2084366f539d6ec569aaf7ab78582a34f006f004266777cd19" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000015180", + "logIndex": 76, + "blockHash": "0x900b45cebe66522d3fb8044dd0005358c83df8c4d3ba516b6ec29c90a0c8e67c" + }, + { + "transactionIndex": 25, + "blockNumber": 36229431, + "transactionHash": "0x87729b9d78006af78452c4c341370864bc6b8b430c2e58515f2755bff96b1e89", + "address": "0x52325504bD35aeC31D842F62A113E9e4b665d885", + "topics": [ + "0xeb70b03fab908e126e5efc33f8dfd2731fa89c716282a86769025f8dd4a6c1e0", + "0x00000000000000000000000044b1d66e7b9d4467139924f31754f34cbc392f44" + ], + "data": "0x", + "logIndex": 77, + "blockHash": "0x900b45cebe66522d3fb8044dd0005358c83df8c4d3ba516b6ec29c90a0c8e67c" + }, + { + "transactionIndex": 25, + "blockNumber": 36229431, + "transactionHash": "0x87729b9d78006af78452c4c341370864bc6b8b430c2e58515f2755bff96b1e89", + "address": "0x52325504bD35aeC31D842F62A113E9e4b665d885", + "topics": [ + "0xf935763cc7c57ee8ed6318ed71e756cca0731294c9f46ff5b386f36d6ff1417a", + "0x0000000000000000000000007402d9f36904894273b31dd0d998d826c833ef93" + ], + "data": "0x", + "logIndex": 78, + "blockHash": "0x900b45cebe66522d3fb8044dd0005358c83df8c4d3ba516b6ec29c90a0c8e67c" + }, + { + "transactionIndex": 25, + "blockNumber": 36229431, + "transactionHash": "0x87729b9d78006af78452c4c341370864bc6b8b430c2e58515f2755bff96b1e89", + "address": "0x52325504bD35aeC31D842F62A113E9e4b665d885", + "topics": [ + "0x521671714dd36d366adf3fe2efec91d3f58a3131aad68e268821d8144b5d0845" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000001c20", + "logIndex": 79, + "blockHash": "0x900b45cebe66522d3fb8044dd0005358c83df8c4d3ba516b6ec29c90a0c8e67c" + }, + { + "transactionIndex": 25, + "blockNumber": 36229431, + "transactionHash": "0x87729b9d78006af78452c4c341370864bc6b8b430c2e58515f2755bff96b1e89", + "address": "0x52325504bD35aeC31D842F62A113E9e4b665d885", + "topics": [ + "0x3125f2f28108d5eabe48aa2a11adff21d6f9244f0436278992999404ba4fc5ad" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000019b00000000000000000000000000000000000000000000000000000000638656b0", + "logIndex": 80, + "blockHash": "0x900b45cebe66522d3fb8044dd0005358c83df8c4d3ba516b6ec29c90a0c8e67c" + }, + { + "transactionIndex": 25, + "blockNumber": 36229431, + "transactionHash": "0x87729b9d78006af78452c4c341370864bc6b8b430c2e58515f2755bff96b1e89", + "address": "0x52325504bD35aeC31D842F62A113E9e4b665d885", + "topics": [ + "0x9e5f7e6ac833c4735b5548bbeec59dac4d413789aa351fbe11a654dac0c4306c", + "0x00000000000000000000000000000000000000000000000000000000638656b0" + ], + "data": "0x", + "logIndex": 81, + "blockHash": "0x900b45cebe66522d3fb8044dd0005358c83df8c4d3ba516b6ec29c90a0c8e67c" + }, + { + "transactionIndex": 25, + "blockNumber": 36229431, + "transactionHash": "0x87729b9d78006af78452c4c341370864bc6b8b430c2e58515f2755bff96b1e89", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x0000000000000000000000004d40eb12430a57965cee3015348d490c6156df20", + "0x000000000000000000000000794e44d1334a56fea7f4df12633b88820d0c5888" + ], + "data": "0x0000000000000000000000000000000000000000000000000122774fd497f9f000000000000000000000000000000000000000000000000020385761f2cc167a0000000000000000000000000000000000000000000001902d95295c4e4eb28d0000000000000000000000000000000000000000000000001f15e0121e341c8a0000000000000000000000000000000000000000000001902eb7a0ac22e6ac7d", + "logIndex": 82, + "blockHash": "0x900b45cebe66522d3fb8044dd0005358c83df8c4d3ba516b6ec29c90a0c8e67c" + } + ], + "blockNumber": 36229431, + "cumulativeGasUsed": "5035409", + "status": 1, + "byzantium": true + }, + "args": [ + "0x4D40eb12430A57965cEe3015348d490C6156dF20", + "0x44B1d66E7B9d4467139924f31754F34cbC392f44", + "0x7402d9f36904894273B31dD0d998D826c833EF93", + 411, + 1669748400, + 86400, + 7200 + ], + "numDeployments": 1, + "solcInputHash": "81bc9ae0cb2caeb2744ac5c81556a380", + "metadata": "{\"compiler\":{\"version\":\"0.8.6+commit.11564f7e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"contract IDrawBuffer\",\"name\":\"_drawBuffer\",\"type\":\"address\"},{\"internalType\":\"contract RNGInterface\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_nextDrawId\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"_beaconPeriodStart\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"_beaconPeriodSeconds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_rngTimeout\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"drawPeriodSeconds\",\"type\":\"uint32\"}],\"name\":\"BeaconPeriodSecondsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"startedAt\",\"type\":\"uint64\"}],\"name\":\"BeaconPeriodStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"nextDrawId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"beaconPeriodStartedAt\",\"type\":\"uint64\"}],\"name\":\"Deployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IDrawBuffer\",\"name\":\"newDrawBuffer\",\"type\":\"address\"}],\"name\":\"DrawBufferUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"rngRequestId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"rngLockBlock\",\"type\":\"uint32\"}],\"name\":\"DrawCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"randomNumber\",\"type\":\"uint256\"}],\"name\":\"DrawCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"rngRequestId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"rngLockBlock\",\"type\":\"uint32\"}],\"name\":\"DrawStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pendingOwner\",\"type\":\"address\"}],\"name\":\"OwnershipOffered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract RNGInterface\",\"name\":\"rngService\",\"type\":\"address\"}],\"name\":\"RngServiceUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"rngTimeout\",\"type\":\"uint32\"}],\"name\":\"RngTimeoutSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"beaconPeriodEndAt\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beaconPeriodRemainingSeconds\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_time\",\"type\":\"uint64\"}],\"name\":\"calculateNextBeaconPeriodStartTime\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"calculateNextBeaconPeriodStartTimeFromCurrentTime\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"canCompleteDraw\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"canStartDraw\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelDraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"completeDraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBeaconPeriodSeconds\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBeaconPeriodStartedAt\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDrawBuffer\",\"outputs\":[{\"internalType\":\"contract IDrawBuffer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastRngLockBlock\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastRngRequestId\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNextDrawId\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRngService\",\"outputs\":[{\"internalType\":\"contract RNGInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRngTimeout\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isBeaconPeriodOver\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRngCompleted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRngRequested\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRngTimedOut\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_beaconPeriodSeconds\",\"type\":\"uint32\"}],\"name\":\"setBeaconPeriodSeconds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDrawBuffer\",\"name\":\"newDrawBuffer\",\"type\":\"address\"}],\"name\":\"setDrawBuffer\",\"outputs\":[{\"internalType\":\"contract IDrawBuffer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract RNGInterface\",\"name\":\"_rngService\",\"type\":\"address\"}],\"name\":\"setRngService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_rngTimeout\",\"type\":\"uint32\"}],\"name\":\"setRngTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startDraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"PoolTogether Inc Team\",\"events\":{\"Deployed(uint32,uint64)\":{\"params\":{\"beaconPeriodStartedAt\":\"Timestamp when beacon period starts.\",\"nextDrawId\":\"Draw ID at which the DrawBeacon should start. Can't be inferior to 1.\"}}},\"kind\":\"dev\",\"methods\":{\"beaconPeriodEndAt()\":{\"returns\":{\"_0\":\"The timestamp at which the beacon period ends.\"}},\"beaconPeriodRemainingSeconds()\":{\"returns\":{\"_0\":\"The number of seconds remaining until the beacon period can be complete.\"}},\"calculateNextBeaconPeriodStartTime(uint64)\":{\"params\":{\"time\":\"The timestamp to use as the current time\"},\"returns\":{\"_0\":\"The timestamp at which the next beacon period would start\"}},\"calculateNextBeaconPeriodStartTimeFromCurrentTime()\":{\"returns\":{\"_0\":\"The next beacon period start time\"}},\"canCompleteDraw()\":{\"returns\":{\"_0\":\"True if a Draw can be completed, false otherwise.\"}},\"canStartDraw()\":{\"returns\":{\"_0\":\"True if a Draw can be started, false otherwise.\"}},\"claimOwnership()\":{\"details\":\"This function is only callable by the `_pendingOwner`.\"},\"constructor\":{\"params\":{\"_beaconPeriodSeconds\":\"The duration of the beacon period in seconds\",\"_beaconPeriodStart\":\"The starting timestamp of the beacon period.\",\"_drawBuffer\":\"The address of the draw buffer to push draws to\",\"_nextDrawId\":\"Draw ID at which the DrawBeacon should start. Can't be inferior to 1.\",\"_owner\":\"Address of the DrawBeacon owner\",\"_rng\":\"The RNG service to use\"}},\"getLastRngLockBlock()\":{\"returns\":{\"_0\":\"The block number that the RNG request is locked to\"}},\"getLastRngRequestId()\":{\"returns\":{\"_0\":\"The current Request ID\"}},\"isBeaconPeriodOver()\":{\"returns\":{\"_0\":\"True if the beacon period is over, false otherwise\"}},\"isRngCompleted()\":{\"returns\":{\"_0\":\"True if a random number request has completed, false otherwise.\"}},\"isRngRequested()\":{\"returns\":{\"_0\":\"True if a random number has been requested, false otherwise.\"}},\"isRngTimedOut()\":{\"returns\":{\"_0\":\"True if a random number request has timed out, false otherwise.\"}},\"pendingOwner()\":{\"returns\":{\"_0\":\"Current `_pendingOwner` address.\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setBeaconPeriodSeconds(uint32)\":{\"params\":{\"beaconPeriodSeconds\":\"The new beacon period in seconds. Must be greater than zero.\"}},\"setDrawBuffer(address)\":{\"details\":\"All subsequent Draw requests/completions will be pushed to the new DrawBuffer.\",\"params\":{\"newDrawBuffer\":\"DrawBuffer address\"},\"returns\":{\"_0\":\"DrawBuffer\"}},\"setRngService(address)\":{\"params\":{\"rngService\":\"The address of the new RNG service interface\"}},\"setRngTimeout(uint32)\":{\"params\":{\"rngTimeout\":\"The RNG request timeout in seconds.\"}},\"startDraw()\":{\"details\":\"The RNG-Request-Fee is expected to be held within this contract before calling this function\"},\"transferOwnership(address)\":{\"params\":{\"_newOwner\":\"Address to transfer ownership to.\"}}},\"stateVariables\":{\"nextDrawId\":{\"details\":\"Starts at 1. This way we know that no Draw has been recorded at 0.\"},\"rngTimeout\":{\"details\":\"If the rng completes the award can still be cancelled.\"}},\"title\":\"PoolTogether V4 DrawBeacon\",\"version\":1},\"userdoc\":{\"events\":{\"BeaconPeriodSecondsUpdated(uint32)\":{\"notice\":\"Emit when the drawPeriodSeconds is set.\"},\"BeaconPeriodStarted(uint64)\":{\"notice\":\"Emit when a draw has opened.\"},\"Deployed(uint32,uint64)\":{\"notice\":\"Emit when the DrawBeacon is deployed.\"},\"DrawBufferUpdated(address)\":{\"notice\":\"Emit when a new DrawBuffer has been set.\"},\"DrawCancelled(uint32,uint32)\":{\"notice\":\"Emit when a draw has been cancelled.\"},\"DrawCompleted(uint256)\":{\"notice\":\"Emit when a draw has been completed.\"},\"DrawStarted(uint32,uint32)\":{\"notice\":\"Emit when a draw has started.\"},\"RngServiceUpdated(address)\":{\"notice\":\"Emit when a RNG service address is set.\"},\"RngTimeoutSet(uint32)\":{\"notice\":\"Emit when a draw timeout param is set.\"}},\"kind\":\"user\",\"methods\":{\"beaconPeriodEndAt()\":{\"notice\":\"Returns the timestamp at which the beacon period ends\"},\"beaconPeriodRemainingSeconds()\":{\"notice\":\"Returns the number of seconds remaining until the beacon period can be complete.\"},\"calculateNextBeaconPeriodStartTime(uint64)\":{\"notice\":\"Calculates when the next beacon period will start.\"},\"calculateNextBeaconPeriodStartTimeFromCurrentTime()\":{\"notice\":\"Calculates the next beacon start time, assuming all beacon periods have occurred between the last and now.\"},\"canCompleteDraw()\":{\"notice\":\"Returns whether a Draw can be completed.\"},\"canStartDraw()\":{\"notice\":\"Returns whether a Draw can be started.\"},\"cancelDraw()\":{\"notice\":\"Can be called by anyone to cancel the draw request if the RNG has timed out.\"},\"claimOwnership()\":{\"notice\":\"Allows the `_pendingOwner` address to finalize the transfer.\"},\"completeDraw()\":{\"notice\":\"Completes the Draw (RNG) request and pushes a Draw onto DrawBuffer.\"},\"constructor\":{\"notice\":\"Deploy the DrawBeacon smart contract.\"},\"getLastRngLockBlock()\":{\"notice\":\"Returns the block number that the current RNG request has been locked to.\"},\"getLastRngRequestId()\":{\"notice\":\"Returns the current RNG Request ID.\"},\"isBeaconPeriodOver()\":{\"notice\":\"Returns whether the beacon period is over\"},\"isRngCompleted()\":{\"notice\":\"Returns whether the random number request has completed.\"},\"isRngRequested()\":{\"notice\":\"Returns whether a random number has been requested\"},\"isRngTimedOut()\":{\"notice\":\"Returns whether the random number request has timed out.\"},\"owner()\":{\"notice\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"notice\":\"Gets current `_pendingOwner`.\"},\"renounceOwnership()\":{\"notice\":\"Renounce ownership of the contract.\"},\"setBeaconPeriodSeconds(uint32)\":{\"notice\":\"Allows the owner to set the beacon period in seconds.\"},\"setDrawBuffer(address)\":{\"notice\":\"Set global DrawBuffer variable.\"},\"setRngService(address)\":{\"notice\":\"Sets the RNG service that the Prize Strategy is connected to\"},\"setRngTimeout(uint32)\":{\"notice\":\"Allows the owner to set the RNG request timeout in seconds. This is the time that must elapsed before the RNG request can be cancelled and the pool unlocked.\"},\"startDraw()\":{\"notice\":\"Starts the Draw process by starting random number request. The previous beacon period must have ended.\"},\"transferOwnership(address)\":{\"notice\":\"Allows current owner to set the `_pendingOwner` address.\"}},\"notice\":\"Manages RNG (random number generator) requests and pushing Draws onto DrawBuffer. The DrawBeacon has 3 major actions for requesting a random number: start, cancel and complete. To create a new Draw, the user requests a new random number from the RNG service. When the random number is available, the user can create the draw using the create() method which will push the draw onto the DrawBuffer. If the RNG service fails to deliver a rng, when the request timeout elapses, the user can cancel the request.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@pooltogether/v4-core/contracts/DrawBeacon.sol\":\"DrawBeacon\"},\"evmVersion\":\"berlin\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":2000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0x61437cb513a887a1bbad006e7b1c8b414478427d33de47c5600af3c748f108da\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc3d946432c0ddbb1f846a0d3985be71299df331b91d06732152117f62f0be2b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n assembly {\\n size := extcodesize(account)\\n }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x51b758a8815ecc9596c66c37d56b1d33883a444631a3f916b9fe65cb863ef7c4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n require(value <= type(uint224).max, \\\"SafeCast: value doesn't fit in 224 bits\\\");\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n require(value <= type(uint128).max, \\\"SafeCast: value doesn't fit in 128 bits\\\");\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n require(value <= type(uint96).max, \\\"SafeCast: value doesn't fit in 96 bits\\\");\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n require(value <= type(uint64).max, \\\"SafeCast: value doesn't fit in 64 bits\\\");\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n require(value <= type(uint32).max, \\\"SafeCast: value doesn't fit in 32 bits\\\");\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n require(value <= type(uint16).max, \\\"SafeCast: value doesn't fit in 16 bits\\\");\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits.\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n require(value <= type(uint8).max, \\\"SafeCast: value doesn't fit in 8 bits\\\");\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128) {\\n require(value >= type(int128).min && value <= type(int128).max, \\\"SafeCast: value doesn't fit in 128 bits\\\");\\n return int128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64) {\\n require(value >= type(int64).min && value <= type(int64).max, \\\"SafeCast: value doesn't fit in 64 bits\\\");\\n return int64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32) {\\n require(value >= type(int32).min && value <= type(int32).max, \\\"SafeCast: value doesn't fit in 32 bits\\\");\\n return int32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16) {\\n require(value >= type(int16).min && value <= type(int16).max, \\\"SafeCast: value doesn't fit in 16 bits\\\");\\n return int16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits.\\n *\\n * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8) {\\n require(value >= type(int8).min && value <= type(int8).max, \\\"SafeCast: value doesn't fit in 8 bits\\\");\\n return int8(value);\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n require(value <= uint256(type(int256).max), \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0x5c6caab697d302ad7eb59c234a4d2dbc965c1bae87709bd2850060b7695b28c7\",\"license\":\"MIT\"},\"@pooltogether/owner-manager-contracts/contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Abstract ownable contract that can be inherited by other contracts\\n * @notice Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner is the deployer of the contract.\\n *\\n * The owner account is set through a two steps process.\\n * 1. The current `owner` calls {transferOwnership} to set a `pendingOwner`\\n * 2. The `pendingOwner` calls {acceptOwnership} to accept the ownership transfer\\n *\\n * The manager account needs to be set using {setManager}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable {\\n address private _owner;\\n address private _pendingOwner;\\n\\n /**\\n * @dev Emitted when `_pendingOwner` has been changed.\\n * @param pendingOwner new `_pendingOwner` address.\\n */\\n event OwnershipOffered(address indexed pendingOwner);\\n\\n /**\\n * @dev Emitted when `_owner` has been changed.\\n * @param previousOwner previous `_owner` address.\\n * @param newOwner new `_owner` address.\\n */\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /* ============ Deploy ============ */\\n\\n /**\\n * @notice Initializes the contract setting `_initialOwner` as the initial owner.\\n * @param _initialOwner Initial owner of the contract.\\n */\\n constructor(address _initialOwner) {\\n _setOwner(_initialOwner);\\n }\\n\\n /* ============ External Functions ============ */\\n\\n /**\\n * @notice Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @notice Gets current `_pendingOwner`.\\n * @return Current `_pendingOwner` address.\\n */\\n function pendingOwner() external view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @notice Renounce ownership of the contract.\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n _setOwner(address(0));\\n }\\n\\n /**\\n * @notice Allows current owner to set the `_pendingOwner` address.\\n * @param _newOwner Address to transfer ownership to.\\n */\\n function transferOwnership(address _newOwner) external onlyOwner {\\n require(_newOwner != address(0), \\\"Ownable/pendingOwner-not-zero-address\\\");\\n\\n _pendingOwner = _newOwner;\\n\\n emit OwnershipOffered(_newOwner);\\n }\\n\\n /**\\n * @notice Allows the `_pendingOwner` address to finalize the transfer.\\n * @dev This function is only callable by the `_pendingOwner`.\\n */\\n function claimOwnership() external onlyPendingOwner {\\n _setOwner(_pendingOwner);\\n _pendingOwner = address(0);\\n }\\n\\n /* ============ Internal Functions ============ */\\n\\n /**\\n * @notice Internal function to set the `_owner` of the contract.\\n * @param _newOwner New `_owner` address.\\n */\\n function _setOwner(address _newOwner) private {\\n address _oldOwner = _owner;\\n _owner = _newOwner;\\n emit OwnershipTransferred(_oldOwner, _newOwner);\\n }\\n\\n /* ============ Modifier Functions ============ */\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == msg.sender, \\\"Ownable/caller-not-owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the `pendingOwner`.\\n */\\n modifier onlyPendingOwner() {\\n require(msg.sender == _pendingOwner, \\\"Ownable/caller-not-pendingOwner\\\");\\n _;\\n }\\n}\\n\",\"keccak256\":\"0xfd0fd374812c8af45f2633cc7cc4811ccb7bad0a3902a43aded35939eb4a00d1\",\"license\":\"GPL-3.0\"},\"@pooltogether/pooltogether-rng-contracts/contracts/RNGInterface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\n/**\\n * @title Random Number Generator Interface\\n * @notice Provides an interface for requesting random numbers from 3rd-party RNG services (Chainlink VRF, Starkware VDF, etc..)\\n */\\ninterface RNGInterface {\\n /**\\n * @notice Emitted when a new request for a random number has been submitted\\n * @param requestId The indexed ID of the request used to get the results of the RNG service\\n * @param sender The indexed address of the sender of the request\\n */\\n event RandomNumberRequested(uint32 indexed requestId, address indexed sender);\\n\\n /**\\n * @notice Emitted when an existing request for a random number has been completed\\n * @param requestId The indexed ID of the request used to get the results of the RNG service\\n * @param randomNumber The random number produced by the 3rd-party service\\n */\\n event RandomNumberCompleted(uint32 indexed requestId, uint256 randomNumber);\\n\\n /**\\n * @notice Gets the last request id used by the RNG service\\n * @return requestId The last request id used in the last request\\n */\\n function getLastRequestId() external view returns (uint32 requestId);\\n\\n /**\\n * @notice Gets the Fee for making a Request against an RNG service\\n * @return feeToken The address of the token that is used to pay fees\\n * @return requestFee The fee required to be paid to make a request\\n */\\n function getRequestFee() external view returns (address feeToken, uint256 requestFee);\\n\\n /**\\n * @notice Sends a request for a random number to the 3rd-party service\\n * @dev Some services will complete the request immediately, others may have a time-delay\\n * @dev Some services require payment in the form of a token, such as $LINK for Chainlink VRF\\n * @return requestId The ID of the request used to get the results of the RNG service\\n * @return lockBlock The block number at which the RNG service will start generating time-delayed randomness.\\n * The calling contract should \\\"lock\\\" all activity until the result is available via the `requestId`\\n */\\n function requestRandomNumber() external returns (uint32 requestId, uint32 lockBlock);\\n\\n /**\\n * @notice Checks if the request for randomness from the 3rd-party service has completed\\n * @dev For time-delayed requests, this function is used to check/confirm completion\\n * @param requestId The ID of the request used to get the results of the RNG service\\n * @return isCompleted True if the request has completed and a random number is available, false otherwise\\n */\\n function isRequestComplete(uint32 requestId) external view returns (bool isCompleted);\\n\\n /**\\n * @notice Gets the random number produced by the 3rd-party service\\n * @param requestId The ID of the request used to get the results of the RNG service\\n * @return randomNum The random number\\n */\\n function randomNumber(uint32 requestId) external returns (uint256 randomNum);\\n}\\n\",\"keccak256\":\"0x24803ae776bba768a3a3f65d3b7e5fc100c7b5881a8e5e39d6c5df2735a3b5cb\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/DrawBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport \\\"@pooltogether/pooltogether-rng-contracts/contracts/RNGInterface.sol\\\";\\nimport \\\"@pooltogether/owner-manager-contracts/contracts/Ownable.sol\\\";\\n\\nimport \\\"./interfaces/IDrawBeacon.sol\\\";\\nimport \\\"./interfaces/IDrawBuffer.sol\\\";\\n\\n\\n/**\\n * @title PoolTogether V4 DrawBeacon\\n * @author PoolTogether Inc Team\\n * @notice Manages RNG (random number generator) requests and pushing Draws onto DrawBuffer.\\n The DrawBeacon has 3 major actions for requesting a random number: start, cancel and complete.\\n To create a new Draw, the user requests a new random number from the RNG service.\\n When the random number is available, the user can create the draw using the create() method\\n which will push the draw onto the DrawBuffer.\\n If the RNG service fails to deliver a rng, when the request timeout elapses, the user can cancel the request.\\n*/\\ncontract DrawBeacon is IDrawBeacon, Ownable {\\n using SafeCast for uint256;\\n using SafeERC20 for IERC20;\\n\\n /* ============ Variables ============ */\\n\\n /// @notice RNG contract interface\\n RNGInterface internal rng;\\n\\n /// @notice Current RNG Request\\n RngRequest internal rngRequest;\\n\\n /// @notice DrawBuffer address\\n IDrawBuffer internal drawBuffer;\\n\\n /**\\n * @notice RNG Request Timeout. In fact, this is really a \\\"complete draw\\\" timeout.\\n * @dev If the rng completes the award can still be cancelled.\\n */\\n uint32 internal rngTimeout;\\n\\n /// @notice Seconds between beacon period request\\n uint32 internal beaconPeriodSeconds;\\n\\n /// @notice Epoch timestamp when beacon period can start\\n uint64 internal beaconPeriodStartedAt;\\n\\n /**\\n * @notice Next Draw ID to use when pushing a Draw onto DrawBuffer\\n * @dev Starts at 1. This way we know that no Draw has been recorded at 0.\\n */\\n uint32 internal nextDrawId;\\n\\n /* ============ Structs ============ */\\n\\n /**\\n * @notice RNG Request\\n * @param id RNG request ID\\n * @param lockBlock Block number that the RNG request is locked\\n * @param requestedAt Time when RNG is requested\\n */\\n struct RngRequest {\\n uint32 id;\\n uint32 lockBlock;\\n uint64 requestedAt;\\n }\\n\\n /* ============ Events ============ */\\n\\n /**\\n * @notice Emit when the DrawBeacon is deployed.\\n * @param nextDrawId Draw ID at which the DrawBeacon should start. Can't be inferior to 1.\\n * @param beaconPeriodStartedAt Timestamp when beacon period starts.\\n */\\n event Deployed(\\n uint32 nextDrawId,\\n uint64 beaconPeriodStartedAt\\n );\\n\\n /* ============ Modifiers ============ */\\n\\n modifier requireDrawNotStarted() {\\n _requireDrawNotStarted();\\n _;\\n }\\n\\n modifier requireCanStartDraw() {\\n require(_isBeaconPeriodOver(), \\\"DrawBeacon/beacon-period-not-over\\\");\\n require(!isRngRequested(), \\\"DrawBeacon/rng-already-requested\\\");\\n _;\\n }\\n\\n modifier requireCanCompleteRngRequest() {\\n require(isRngRequested(), \\\"DrawBeacon/rng-not-requested\\\");\\n require(isRngCompleted(), \\\"DrawBeacon/rng-not-complete\\\");\\n _;\\n }\\n\\n /* ============ Constructor ============ */\\n\\n /**\\n * @notice Deploy the DrawBeacon smart contract.\\n * @param _owner Address of the DrawBeacon owner\\n * @param _drawBuffer The address of the draw buffer to push draws to\\n * @param _rng The RNG service to use\\n * @param _nextDrawId Draw ID at which the DrawBeacon should start. Can't be inferior to 1.\\n * @param _beaconPeriodStart The starting timestamp of the beacon period.\\n * @param _beaconPeriodSeconds The duration of the beacon period in seconds\\n */\\n constructor(\\n address _owner,\\n IDrawBuffer _drawBuffer,\\n RNGInterface _rng,\\n uint32 _nextDrawId,\\n uint64 _beaconPeriodStart,\\n uint32 _beaconPeriodSeconds,\\n uint32 _rngTimeout\\n ) Ownable(_owner) {\\n require(_beaconPeriodStart > 0, \\\"DrawBeacon/beacon-period-greater-than-zero\\\");\\n require(address(_rng) != address(0), \\\"DrawBeacon/rng-not-zero\\\");\\n require(_nextDrawId >= 1, \\\"DrawBeacon/next-draw-id-gte-one\\\");\\n\\n beaconPeriodStartedAt = _beaconPeriodStart;\\n nextDrawId = _nextDrawId;\\n\\n _setBeaconPeriodSeconds(_beaconPeriodSeconds);\\n _setDrawBuffer(_drawBuffer);\\n _setRngService(_rng);\\n _setRngTimeout(_rngTimeout);\\n\\n emit Deployed(_nextDrawId, _beaconPeriodStart);\\n emit BeaconPeriodStarted(_beaconPeriodStart);\\n }\\n\\n /* ============ Public Functions ============ */\\n\\n /**\\n * @notice Returns whether the random number request has completed.\\n * @return True if a random number request has completed, false otherwise.\\n */\\n function isRngCompleted() public view override returns (bool) {\\n return rng.isRequestComplete(rngRequest.id);\\n }\\n\\n /**\\n * @notice Returns whether a random number has been requested\\n * @return True if a random number has been requested, false otherwise.\\n */\\n function isRngRequested() public view override returns (bool) {\\n return rngRequest.id != 0;\\n }\\n\\n /**\\n * @notice Returns whether the random number request has timed out.\\n * @return True if a random number request has timed out, false otherwise.\\n */\\n function isRngTimedOut() public view override returns (bool) {\\n if (rngRequest.requestedAt == 0) {\\n return false;\\n } else {\\n return rngTimeout + rngRequest.requestedAt < _currentTime();\\n }\\n }\\n\\n /* ============ External Functions ============ */\\n\\n /// @inheritdoc IDrawBeacon\\n function canStartDraw() external view override returns (bool) {\\n return _isBeaconPeriodOver() && !isRngRequested();\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function canCompleteDraw() external view override returns (bool) {\\n return isRngRequested() && isRngCompleted();\\n }\\n\\n /// @notice Calculates the next beacon start time, assuming all beacon periods have occurred between the last and now.\\n /// @return The next beacon period start time\\n function calculateNextBeaconPeriodStartTimeFromCurrentTime() external view returns (uint64) {\\n return\\n _calculateNextBeaconPeriodStartTime(\\n beaconPeriodStartedAt,\\n beaconPeriodSeconds,\\n _currentTime()\\n );\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function calculateNextBeaconPeriodStartTime(uint64 _time)\\n external\\n view\\n override\\n returns (uint64)\\n {\\n return\\n _calculateNextBeaconPeriodStartTime(\\n beaconPeriodStartedAt,\\n beaconPeriodSeconds,\\n _time\\n );\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function cancelDraw() external override {\\n require(isRngTimedOut(), \\\"DrawBeacon/rng-not-timedout\\\");\\n uint32 requestId = rngRequest.id;\\n uint32 lockBlock = rngRequest.lockBlock;\\n delete rngRequest;\\n emit DrawCancelled(requestId, lockBlock);\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function completeDraw() external override requireCanCompleteRngRequest {\\n uint256 randomNumber = rng.randomNumber(rngRequest.id);\\n uint32 _nextDrawId = nextDrawId;\\n uint64 _beaconPeriodStartedAt = beaconPeriodStartedAt;\\n uint32 _beaconPeriodSeconds = beaconPeriodSeconds;\\n uint64 _time = _currentTime();\\n\\n // create Draw struct\\n IDrawBeacon.Draw memory _draw = IDrawBeacon.Draw({\\n winningRandomNumber: randomNumber,\\n drawId: _nextDrawId,\\n timestamp: rngRequest.requestedAt, // must use the startAward() timestamp to prevent front-running\\n beaconPeriodStartedAt: _beaconPeriodStartedAt,\\n beaconPeriodSeconds: _beaconPeriodSeconds\\n });\\n\\n drawBuffer.pushDraw(_draw);\\n\\n // to avoid clock drift, we should calculate the start time based on the previous period start time.\\n uint64 nextBeaconPeriodStartedAt = _calculateNextBeaconPeriodStartTime(\\n _beaconPeriodStartedAt,\\n _beaconPeriodSeconds,\\n _time\\n );\\n beaconPeriodStartedAt = nextBeaconPeriodStartedAt;\\n nextDrawId = _nextDrawId + 1;\\n\\n // Reset the rngRequest state so Beacon period can start again.\\n delete rngRequest;\\n\\n emit DrawCompleted(randomNumber);\\n emit BeaconPeriodStarted(nextBeaconPeriodStartedAt);\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function beaconPeriodRemainingSeconds() external view override returns (uint64) {\\n return _beaconPeriodRemainingSeconds();\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function beaconPeriodEndAt() external view override returns (uint64) {\\n return _beaconPeriodEndAt();\\n }\\n\\n function getBeaconPeriodSeconds() external view returns (uint32) {\\n return beaconPeriodSeconds;\\n }\\n\\n function getBeaconPeriodStartedAt() external view returns (uint64) {\\n return beaconPeriodStartedAt;\\n }\\n\\n function getDrawBuffer() external view returns (IDrawBuffer) {\\n return drawBuffer;\\n }\\n\\n function getNextDrawId() external view returns (uint32) {\\n return nextDrawId;\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function getLastRngLockBlock() external view override returns (uint32) {\\n return rngRequest.lockBlock;\\n }\\n\\n function getLastRngRequestId() external view override returns (uint32) {\\n return rngRequest.id;\\n }\\n\\n function getRngService() external view returns (RNGInterface) {\\n return rng;\\n }\\n\\n function getRngTimeout() external view returns (uint32) {\\n return rngTimeout;\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function isBeaconPeriodOver() external view override returns (bool) {\\n return _isBeaconPeriodOver();\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function setDrawBuffer(IDrawBuffer newDrawBuffer)\\n external\\n override\\n onlyOwner\\n returns (IDrawBuffer)\\n {\\n return _setDrawBuffer(newDrawBuffer);\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function startDraw() external override requireCanStartDraw {\\n (address feeToken, uint256 requestFee) = rng.getRequestFee();\\n\\n if (feeToken != address(0) && requestFee > 0) {\\n IERC20(feeToken).safeIncreaseAllowance(address(rng), requestFee);\\n }\\n\\n (uint32 requestId, uint32 lockBlock) = rng.requestRandomNumber();\\n rngRequest.id = requestId;\\n rngRequest.lockBlock = lockBlock;\\n rngRequest.requestedAt = _currentTime();\\n\\n emit DrawStarted(requestId, lockBlock);\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function setBeaconPeriodSeconds(uint32 _beaconPeriodSeconds)\\n external\\n override\\n onlyOwner\\n requireDrawNotStarted\\n {\\n _setBeaconPeriodSeconds(_beaconPeriodSeconds);\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function setRngTimeout(uint32 _rngTimeout) external override onlyOwner requireDrawNotStarted {\\n _setRngTimeout(_rngTimeout);\\n }\\n\\n /// @inheritdoc IDrawBeacon\\n function setRngService(RNGInterface _rngService)\\n external\\n override\\n onlyOwner\\n requireDrawNotStarted\\n {\\n _setRngService(_rngService);\\n }\\n\\n /**\\n * @notice Sets the RNG service that the Prize Strategy is connected to\\n * @param _rngService The address of the new RNG service interface\\n */\\n function _setRngService(RNGInterface _rngService) internal\\n {\\n rng = _rngService;\\n emit RngServiceUpdated(_rngService);\\n }\\n\\n /* ============ Internal Functions ============ */\\n\\n /**\\n * @notice Calculates when the next beacon period will start\\n * @param _beaconPeriodStartedAt The timestamp at which the beacon period started\\n * @param _beaconPeriodSeconds The duration of the beacon period in seconds\\n * @param _time The timestamp to use as the current time\\n * @return The timestamp at which the next beacon period would start\\n */\\n function _calculateNextBeaconPeriodStartTime(\\n uint64 _beaconPeriodStartedAt,\\n uint32 _beaconPeriodSeconds,\\n uint64 _time\\n ) internal pure returns (uint64) {\\n uint64 elapsedPeriods = (_time - _beaconPeriodStartedAt) / _beaconPeriodSeconds;\\n return _beaconPeriodStartedAt + (elapsedPeriods * _beaconPeriodSeconds);\\n }\\n\\n /**\\n * @notice returns the current time. Used for testing.\\n * @return The current time (block.timestamp)\\n */\\n function _currentTime() internal view virtual returns (uint64) {\\n return uint64(block.timestamp);\\n }\\n\\n /**\\n * @notice Returns the timestamp at which the beacon period ends\\n * @return The timestamp at which the beacon period ends\\n */\\n function _beaconPeriodEndAt() internal view returns (uint64) {\\n return beaconPeriodStartedAt + beaconPeriodSeconds;\\n }\\n\\n /**\\n * @notice Returns the number of seconds remaining until the prize can be awarded.\\n * @return The number of seconds remaining until the prize can be awarded.\\n */\\n function _beaconPeriodRemainingSeconds() internal view returns (uint64) {\\n uint64 endAt = _beaconPeriodEndAt();\\n uint64 time = _currentTime();\\n\\n if (endAt <= time) {\\n return 0;\\n }\\n\\n return endAt - time;\\n }\\n\\n /**\\n * @notice Returns whether the beacon period is over.\\n * @return True if the beacon period is over, false otherwise\\n */\\n function _isBeaconPeriodOver() internal view returns (bool) {\\n return _beaconPeriodEndAt() <= _currentTime();\\n }\\n\\n /**\\n * @notice Check to see draw is in progress.\\n */\\n function _requireDrawNotStarted() internal view {\\n uint256 currentBlock = block.number;\\n\\n require(\\n rngRequest.lockBlock == 0 || currentBlock < rngRequest.lockBlock,\\n \\\"DrawBeacon/rng-in-flight\\\"\\n );\\n }\\n\\n /**\\n * @notice Set global DrawBuffer variable.\\n * @dev All subsequent Draw requests/completions will be pushed to the new DrawBuffer.\\n * @param _newDrawBuffer DrawBuffer address\\n * @return DrawBuffer\\n */\\n function _setDrawBuffer(IDrawBuffer _newDrawBuffer) internal returns (IDrawBuffer) {\\n IDrawBuffer _previousDrawBuffer = drawBuffer;\\n require(address(_newDrawBuffer) != address(0), \\\"DrawBeacon/draw-history-not-zero-address\\\");\\n\\n require(\\n address(_newDrawBuffer) != address(_previousDrawBuffer),\\n \\\"DrawBeacon/existing-draw-history-address\\\"\\n );\\n\\n drawBuffer = _newDrawBuffer;\\n\\n emit DrawBufferUpdated(_newDrawBuffer);\\n\\n return _newDrawBuffer;\\n }\\n\\n /**\\n * @notice Sets the beacon period in seconds.\\n * @param _beaconPeriodSeconds The new beacon period in seconds. Must be greater than zero.\\n */\\n function _setBeaconPeriodSeconds(uint32 _beaconPeriodSeconds) internal {\\n require(_beaconPeriodSeconds > 0, \\\"DrawBeacon/beacon-period-greater-than-zero\\\");\\n beaconPeriodSeconds = _beaconPeriodSeconds;\\n\\n emit BeaconPeriodSecondsUpdated(_beaconPeriodSeconds);\\n }\\n\\n /**\\n * @notice Sets the RNG request timeout in seconds. This is the time that must elapsed before the RNG request can be cancelled and the pool unlocked.\\n * @param _rngTimeout The RNG request timeout in seconds.\\n */\\n function _setRngTimeout(uint32 _rngTimeout) internal {\\n require(_rngTimeout > 60, \\\"DrawBeacon/rng-timeout-gt-60-secs\\\");\\n rngTimeout = _rngTimeout;\\n\\n emit RngTimeoutSet(_rngTimeout);\\n }\\n}\\n\",\"keccak256\":\"0xee85be5d2589d345c67eaed219009338addc41cf6ac3b74b1ebd8fdd7de404da\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/IDrawBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@pooltogether/pooltogether-rng-contracts/contracts/RNGInterface.sol\\\";\\nimport \\\"./IDrawBuffer.sol\\\";\\n\\n/** @title IDrawBeacon\\n * @author PoolTogether Inc Team\\n * @notice The DrawBeacon interface.\\n*/\\ninterface IDrawBeacon {\\n\\n /// @notice Draw struct created every draw\\n /// @param winningRandomNumber The random number returned from the RNG service\\n /// @param drawId The monotonically increasing drawId for each draw\\n /// @param timestamp Unix timestamp of the draw. Recorded when the draw is created by the DrawBeacon.\\n /// @param beaconPeriodStartedAt Unix timestamp of when the draw started\\n /// @param beaconPeriodSeconds Unix timestamp of the beacon draw period for this draw.\\n struct Draw {\\n uint256 winningRandomNumber;\\n uint32 drawId;\\n uint64 timestamp;\\n uint64 beaconPeriodStartedAt;\\n uint32 beaconPeriodSeconds;\\n }\\n\\n /**\\n * @notice Emit when a new DrawBuffer has been set.\\n * @param newDrawBuffer The new DrawBuffer address\\n */\\n event DrawBufferUpdated(IDrawBuffer indexed newDrawBuffer);\\n\\n /**\\n * @notice Emit when a draw has opened.\\n * @param startedAt Start timestamp\\n */\\n event BeaconPeriodStarted(uint64 indexed startedAt);\\n\\n /**\\n * @notice Emit when a draw has started.\\n * @param rngRequestId draw id\\n * @param rngLockBlock Block when draw becomes invalid\\n */\\n event DrawStarted(uint32 indexed rngRequestId, uint32 rngLockBlock);\\n\\n /**\\n * @notice Emit when a draw has been cancelled.\\n * @param rngRequestId draw id\\n * @param rngLockBlock Block when draw becomes invalid\\n */\\n event DrawCancelled(uint32 indexed rngRequestId, uint32 rngLockBlock);\\n\\n /**\\n * @notice Emit when a draw has been completed.\\n * @param randomNumber Random number generated from draw\\n */\\n event DrawCompleted(uint256 randomNumber);\\n\\n /**\\n * @notice Emit when a RNG service address is set.\\n * @param rngService RNG service address\\n */\\n event RngServiceUpdated(RNGInterface indexed rngService);\\n\\n /**\\n * @notice Emit when a draw timeout param is set.\\n * @param rngTimeout draw timeout param in seconds\\n */\\n event RngTimeoutSet(uint32 rngTimeout);\\n\\n /**\\n * @notice Emit when the drawPeriodSeconds is set.\\n * @param drawPeriodSeconds Time between draw\\n */\\n event BeaconPeriodSecondsUpdated(uint32 drawPeriodSeconds);\\n\\n /**\\n * @notice Returns the number of seconds remaining until the beacon period can be complete.\\n * @return The number of seconds remaining until the beacon period can be complete.\\n */\\n function beaconPeriodRemainingSeconds() external view returns (uint64);\\n\\n /**\\n * @notice Returns the timestamp at which the beacon period ends\\n * @return The timestamp at which the beacon period ends.\\n */\\n function beaconPeriodEndAt() external view returns (uint64);\\n\\n /**\\n * @notice Returns whether a Draw can be started.\\n * @return True if a Draw can be started, false otherwise.\\n */\\n function canStartDraw() external view returns (bool);\\n\\n /**\\n * @notice Returns whether a Draw can be completed.\\n * @return True if a Draw can be completed, false otherwise.\\n */\\n function canCompleteDraw() external view returns (bool);\\n\\n /**\\n * @notice Calculates when the next beacon period will start.\\n * @param time The timestamp to use as the current time\\n * @return The timestamp at which the next beacon period would start\\n */\\n function calculateNextBeaconPeriodStartTime(uint64 time) external view returns (uint64);\\n\\n /**\\n * @notice Can be called by anyone to cancel the draw request if the RNG has timed out.\\n */\\n function cancelDraw() external;\\n\\n /**\\n * @notice Completes the Draw (RNG) request and pushes a Draw onto DrawBuffer.\\n */\\n function completeDraw() external;\\n\\n /**\\n * @notice Returns the block number that the current RNG request has been locked to.\\n * @return The block number that the RNG request is locked to\\n */\\n function getLastRngLockBlock() external view returns (uint32);\\n\\n /**\\n * @notice Returns the current RNG Request ID.\\n * @return The current Request ID\\n */\\n function getLastRngRequestId() external view returns (uint32);\\n\\n /**\\n * @notice Returns whether the beacon period is over\\n * @return True if the beacon period is over, false otherwise\\n */\\n function isBeaconPeriodOver() external view returns (bool);\\n\\n /**\\n * @notice Returns whether the random number request has completed.\\n * @return True if a random number request has completed, false otherwise.\\n */\\n function isRngCompleted() external view returns (bool);\\n\\n /**\\n * @notice Returns whether a random number has been requested\\n * @return True if a random number has been requested, false otherwise.\\n */\\n function isRngRequested() external view returns (bool);\\n\\n /**\\n * @notice Returns whether the random number request has timed out.\\n * @return True if a random number request has timed out, false otherwise.\\n */\\n function isRngTimedOut() external view returns (bool);\\n\\n /**\\n * @notice Allows the owner to set the beacon period in seconds.\\n * @param beaconPeriodSeconds The new beacon period in seconds. Must be greater than zero.\\n */\\n function setBeaconPeriodSeconds(uint32 beaconPeriodSeconds) external;\\n\\n /**\\n * @notice Allows the owner to set the RNG request timeout in seconds. This is the time that must elapsed before the RNG request can be cancelled and the pool unlocked.\\n * @param rngTimeout The RNG request timeout in seconds.\\n */\\n function setRngTimeout(uint32 rngTimeout) external;\\n\\n /**\\n * @notice Sets the RNG service that the Prize Strategy is connected to\\n * @param rngService The address of the new RNG service interface\\n */\\n function setRngService(RNGInterface rngService) external;\\n\\n /**\\n * @notice Starts the Draw process by starting random number request. The previous beacon period must have ended.\\n * @dev The RNG-Request-Fee is expected to be held within this contract before calling this function\\n */\\n function startDraw() external;\\n\\n /**\\n * @notice Set global DrawBuffer variable.\\n * @dev All subsequent Draw requests/completions will be pushed to the new DrawBuffer.\\n * @param newDrawBuffer DrawBuffer address\\n * @return DrawBuffer\\n */\\n function setDrawBuffer(IDrawBuffer newDrawBuffer) external returns (IDrawBuffer);\\n}\\n\",\"keccak256\":\"0x43213073a191399978af2c7464c5e39af09efeeb503005d4e2a79705c40baa32\",\"license\":\"GPL-3.0\"},\"@pooltogether/v4-core/contracts/interfaces/IDrawBuffer.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"../interfaces/IDrawBeacon.sol\\\";\\n\\n/** @title IDrawBuffer\\n * @author PoolTogether Inc Team\\n * @notice The DrawBuffer interface.\\n*/\\ninterface IDrawBuffer {\\n /**\\n * @notice Emit when a new draw has been created.\\n * @param drawId Draw id\\n * @param draw The Draw struct\\n */\\n event DrawSet(uint32 indexed drawId, IDrawBeacon.Draw draw);\\n\\n /**\\n * @notice Read a ring buffer cardinality\\n * @return Ring buffer cardinality\\n */\\n function getBufferCardinality() external view returns (uint32);\\n\\n /**\\n * @notice Read a Draw from the draws ring buffer.\\n * @dev Read a Draw using the Draw.drawId to calculate position in the draws ring buffer.\\n * @param drawId Draw.drawId\\n * @return IDrawBeacon.Draw\\n */\\n function getDraw(uint32 drawId) external view returns (IDrawBeacon.Draw memory);\\n\\n /**\\n * @notice Read multiple Draws from the draws ring buffer.\\n * @dev Read multiple Draws using each drawId to calculate position in the draws ring buffer.\\n * @param drawIds Array of drawIds\\n * @return IDrawBeacon.Draw[]\\n */\\n function getDraws(uint32[] calldata drawIds) external view returns (IDrawBeacon.Draw[] memory);\\n\\n /**\\n * @notice Gets the number of Draws held in the draw ring buffer.\\n * @dev If no Draws have been pushed, it will return 0.\\n * @dev If the ring buffer is full, it will return the cardinality.\\n * @dev Otherwise, it will return the NewestDraw index + 1.\\n * @return Number of Draws held in the draw ring buffer.\\n */\\n function getDrawCount() external view returns (uint32);\\n\\n /**\\n * @notice Read newest Draw from draws ring buffer.\\n * @dev Uses the nextDrawIndex to calculate the most recently added Draw.\\n * @return IDrawBeacon.Draw\\n */\\n function getNewestDraw() external view returns (IDrawBeacon.Draw memory);\\n\\n /**\\n * @notice Read oldest Draw from draws ring buffer.\\n * @dev Finds the oldest Draw by comparing and/or diffing totalDraws with the cardinality.\\n * @return IDrawBeacon.Draw\\n */\\n function getOldestDraw() external view returns (IDrawBeacon.Draw memory);\\n\\n /**\\n * @notice Push Draw onto draws ring buffer history.\\n * @dev Push new draw onto draws history via authorized manager or owner.\\n * @param draw IDrawBeacon.Draw\\n * @return Draw.drawId\\n */\\n function pushDraw(IDrawBeacon.Draw calldata draw) external returns (uint32);\\n\\n /**\\n * @notice Set existing Draw in draws ring buffer with new parameters.\\n * @dev Updating a Draw should be used sparingly and only in the event an incorrect Draw parameter has been stored.\\n * @param newDraw IDrawBeacon.Draw\\n * @return Draw.drawId\\n */\\n function setDraw(IDrawBeacon.Draw calldata newDraw) external returns (uint32);\\n}\\n\",\"keccak256\":\"0x209ff20406b6b45ff5eff40af05c41a5d697441fc84e2e015e6828d874ccaa83\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b50604051620024293803806200242983398101604081905262000034916200058e565b86620000408162000238565b506000836001600160401b031611620000a25760405162461bcd60e51b815260206004820152602a6024820152600080516020620024098339815191526044820152692d7468616e2d7a65726f60b01b60648201526084015b60405180910390fd5b6001600160a01b038516620000fa5760405162461bcd60e51b815260206004820152601760248201527f44726177426561636f6e2f726e672d6e6f742d7a65726f000000000000000000604482015260640162000099565b60018463ffffffff161015620001535760405162461bcd60e51b815260206004820152601f60248201527f44726177426561636f6e2f6e6578742d647261772d69642d6774652d6f6e6500604482015260640162000099565b6005805463ffffffff861668010000000000000000026001600160601b03199091166001600160401b038616171790556200018e8262000288565b62000199866200033d565b50620001a58562000473565b620001b081620004bd565b6040805163ffffffff861681526001600160401b03851660208201527f3125f2f28108d5eabe48aa2a11adff21d6f9244f0436278992999404ba4fc5ad910160405180910390a16040516001600160401b038416907f9e5f7e6ac833c4735b5548bbeec59dac4d413789aa351fbe11a654dac0c4306c90600090a25050505050505062000652565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008163ffffffff1611620002e25760405162461bcd60e51b815260206004820152602a6024820152600080516020620024098339815191526044820152692d7468616e2d7a65726f60b01b606482015260840162000099565b6004805463ffffffff60c01b1916600160c01b63ffffffff8416908102919091179091556040519081527f4727494dbd863e2084366f539d6ec569aaf7ab78582a34f006f004266777cd19906020015b60405180910390a150565b6004546000906001600160a01b03908116908316620003b05760405162461bcd60e51b815260206004820152602860248201527f44726177426561636f6e2f647261772d686973746f72792d6e6f742d7a65726f6044820152672d6164647265737360c01b606482015260840162000099565b806001600160a01b0316836001600160a01b03161415620004255760405162461bcd60e51b815260206004820152602860248201527f44726177426561636f6e2f6578697374696e672d647261772d686973746f72796044820152672d6164647265737360c01b606482015260840162000099565b600480546001600160a01b0319166001600160a01b0385169081179091556040517feb70b03fab908e126e5efc33f8dfd2731fa89c716282a86769025f8dd4a6c1e090600090a25090919050565b600280546001600160a01b0319166001600160a01b0383169081179091556040517ff935763cc7c57ee8ed6318ed71e756cca0731294c9f46ff5b386f36d6ff1417a90600090a250565b603c8163ffffffff16116200051f5760405162461bcd60e51b815260206004820152602160248201527f44726177426561636f6e2f726e672d74696d656f75742d67742d36302d7365636044820152607360f81b606482015260840162000099565b6004805463ffffffff60a01b1916600160a01b63ffffffff8416908102919091179091556040519081527f521671714dd36d366adf3fe2efec91d3f58a3131aad68e268821d8144b5d08459060200162000332565b805163ffffffff811681146200058957600080fd5b919050565b600080600080600080600060e0888a031215620005aa57600080fd5b8751620005b78162000639565b6020890151909750620005ca8162000639565b6040890151909650620005dd8162000639565b9450620005ed6060890162000574565b60808901519094506001600160401b03811681146200060b57600080fd5b92506200061b60a0890162000574565b91506200062b60c0890162000574565b905092959891949750929550565b6001600160a01b03811681146200064f57600080fd5b50565b611da780620006626000396000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c8063738bbea811610104578063a104fd79116100a2578063d1e7765711610071578063d1e77657146103b5578063e30c3978146103bd578063e4a75bb8146103ce578063f2fde38b146103d657600080fd5b8063a104fd791461036d578063a3ae35ab14610375578063ab70d49c14610388578063c57708c21461039b57600080fd5b80637f4296d7116100de5780637f4296d71461032e57806389c36f8e146103415780638da5cb5b14610349578063919bead01461035a57600080fd5b8063738bbea81461030d57806375e38f16146103155780637ce52b181461031d57600080fd5b80633e7a39081161017c5780634e71e0c81161014b5780634e71e0c8146102d45780635020ea56146102dc5780636bea5344146102ef578063715018a61461030557600080fd5b80633e7a39081461028a5780634019f2d61461029f578063412a616a146102c45780634aba4f6b146102cc57600080fd5b80631b5344a2116101b85780631b5344a2146102165780632a7ad6091461024d5780632ae168a61461025b57806339f92c301461026357600080fd5b80630996f6e1146101df5780630bdeecbd146101fc578063111070e414610206575b600080fd5b6101e76103e9565b60405190151581526020015b60405180910390f35b61020461040a565b005b60035463ffffffff1615156101e7565b60045474010000000000000000000000000000000000000000900463ffffffff165b60405163ffffffff90911681526020016101f3565b60035463ffffffff16610238565b6102046107b9565b60055467ffffffffffffffff165b60405167ffffffffffffffff90911681526020016101f3565b600454600160c01b900463ffffffff16610238565b6004546001600160a01b03165b6040516001600160a01b0390911681526020016101f3565b610204610aae565b6101e7610b78565b610204610c17565b6102046102ea366004611ada565b610ca5565b600354640100000000900463ffffffff16610238565b610204610d22565b6101e7610d97565b610271610e16565b6002546001600160a01b03166102ac565b61020461033c366004611a54565b610e20565b610271610e9a565b6000546001600160a01b03166102ac565b610204610368366004611ada565b610ec7565b610271610f41565b610271610383366004611b4e565b610f4b565b6102ac610396366004611a54565b610f7e565b60055468010000000000000000900463ffffffff16610238565b6101e7610ff2565b6001546001600160a01b03166102ac565b6101e7610ffc565b6102046103e4366004611a54565b61101e565b60006103f361115a565b8015610405575060035463ffffffff16155b905090565b60035463ffffffff166104645760405162461bcd60e51b815260206004820152601c60248201527f44726177426561636f6e2f726e672d6e6f742d7265717565737465640000000060448201526064015b60405180910390fd5b61046c610b78565b6104b85760405162461bcd60e51b815260206004820152601b60248201527f44726177426561636f6e2f726e672d6e6f742d636f6d706c6574650000000000604482015260640161045b565b6002546003546040517f9d2a5f9800000000000000000000000000000000000000000000000000000000815263ffffffff90911660048201526000916001600160a01b031690639d2a5f9890602401602060405180830381600087803b15801561052157600080fd5b505af1158015610535573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105599190611ac1565b60055460045491925063ffffffff68010000000000000000820481169267ffffffffffffffff90921691600160c01b90041660006105944290565b6040805160a08101825287815263ffffffff8781166020830190815260035468010000000000000000900467ffffffffffffffff90811684860190815289821660608601908152898516608087019081526004805498517f089eb925000000000000000000000000000000000000000000000000000000008152885191810191909152945186166024860152915183166044850152519091166064830152519091166084820152929350916001600160a01b039091169063089eb9259060a401602060405180830381600087803b15801561066e57600080fd5b505af1158015610682573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a69190611af7565b5060006106b4858585611180565b6005805467ffffffffffffffff191667ffffffffffffffff831617905590506106de866001611bfd565b6005805463ffffffff9290921668010000000000000000027fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff909216919091179055600380547fffffffffffffffffffffffffffffffff000000000000000000000000000000001690556040518781527f13f646a3648ee5b5a0e8d6bc3d2d623fddf38fa7c8c5dfdbdbe6a913112edc6c9060200160405180910390a160405167ffffffffffffffff8216907f9e5f7e6ac833c4735b5548bbeec59dac4d413789aa351fbe11a654dac0c4306c90600090a250505050505050565b6107c161115a565b6108335760405162461bcd60e51b815260206004820152602160248201527f44726177426561636f6e2f626561636f6e2d706572696f642d6e6f742d6f766560448201527f7200000000000000000000000000000000000000000000000000000000000000606482015260840161045b565b60035463ffffffff16156108895760405162461bcd60e51b815260206004820181905260248201527f44726177426561636f6e2f726e672d616c72656164792d726571756573746564604482015260640161045b565b600254604080517f0d37b537000000000000000000000000000000000000000000000000000000008152815160009384936001600160a01b0390911692630d37b5379260048083019392829003018186803b1580156108e757600080fd5b505afa1580156108fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091f9190611a71565b90925090506001600160a01b0382161580159061093c5750600081115b1561095b5760025461095b906001600160a01b038481169116836111c5565b600254604080517f8678a7b2000000000000000000000000000000000000000000000000000000008152815160009384936001600160a01b0390911692638678a7b2926004808301939282900301818787803b1580156109ba57600080fd5b505af11580156109ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f29190611b14565b6003805463ffffffff8084166401000000000267ffffffffffffffff19909216908516171790559092509050610a254290565b6003805467ffffffffffffffff9290921668010000000000000000027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff90921691909117905560405163ffffffff82811682528316907f0de3a7af7d3c2126e4fb96a7065b39f8bb17e3b9111c092e11236942fb38ca619060200160405180910390a250505050565b610ab6610d97565b610b025760405162461bcd60e51b815260206004820152601b60248201527f44726177426561636f6e2f726e672d6e6f742d74696d65646f75740000000000604482015260640161045b565b600380547fffffffffffffffffffffffffffffffff00000000000000000000000000000000811690915560405163ffffffff640100000000830481168083529216919082907f67638a3a7093a89cc6046dca58aa93d6343e30847e8f84fc3759d9d4a3e6e38b9060200160405180910390a25050565b6002546003546040517f3a19b9bc00000000000000000000000000000000000000000000000000000000815263ffffffff90911660048201526000916001600160a01b031690633a19b9bc9060240160206040518083038186803b158015610bdf57600080fd5b505afa158015610bf3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104059190611a9f565b6001546001600160a01b03163314610c715760405162461bcd60e51b815260206004820152601f60248201527f4f776e61626c652f63616c6c65722d6e6f742d70656e64696e674f776e657200604482015260640161045b565b600154610c86906001600160a01b03166112f5565b6001805473ffffffffffffffffffffffffffffffffffffffff19169055565b33610cb86000546001600160a01b031690565b6001600160a01b031614610d0e5760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161045b565b610d16611352565b610d1f816113cc565b50565b33610d356000546001600160a01b031690565b6001600160a01b031614610d8b5760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161045b565b610d9560006112f5565b565b60035460009068010000000000000000900467ffffffffffffffff16610dbd5750600090565b4260035460045467ffffffffffffffff92831692610e0692680100000000000000009004169074010000000000000000000000000000000000000000900463ffffffff16611c25565b67ffffffffffffffff1610905090565b60006104056114cc565b33610e336000546001600160a01b031690565b6001600160a01b031614610e895760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161045b565b610e91611352565b610d1f81611508565b6005546004546000916104059167ffffffffffffffff90911690600160c01b900463ffffffff1642611180565b33610eda6000546001600160a01b031690565b6001600160a01b031614610f305760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161045b565b610f38611352565b610d1f8161155f565b6000610405611647565b600554600454600091610f789167ffffffffffffffff90911690600160c01b900463ffffffff1684611180565b92915050565b600033610f936000546001600160a01b031690565b6001600160a01b031614610fe95760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161045b565b610f7882611672565b600061040561115a565b600061100f60035463ffffffff16151590565b80156104055750610405610b78565b336110316000546001600160a01b031690565b6001600160a01b0316146110875760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161045b565b6001600160a01b0381166111035760405162461bcd60e51b815260206004820152602560248201527f4f776e61626c652f70656e64696e674f776e65722d6e6f742d7a65726f2d616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161045b565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f239a2ddded15777fa246aed5f7e1a9bc69a39d4eb4a397034d1d85766cca7d4c90600090a250565b60004267ffffffffffffffff1661116f611647565b67ffffffffffffffff161115905090565b60008063ffffffff84166111948685611cc6565b61119e9190611c48565b90506111b063ffffffff851682611c96565b6111ba9086611c25565b9150505b9392505050565b6040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e9060440160206040518083038186803b15801561122a57600080fd5b505afa15801561123e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112629190611ac1565b61126c9190611be5565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790529091506112ef9085906117db565b50505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6003544390640100000000900463ffffffff1615806113805750600354640100000000900463ffffffff1681105b610d1f5760405162461bcd60e51b815260206004820152601860248201527f44726177426561636f6e2f726e672d696e2d666c696768740000000000000000604482015260640161045b565b603c8163ffffffff16116114485760405162461bcd60e51b815260206004820152602160248201527f44726177426561636f6e2f726e672d74696d656f75742d67742d36302d73656360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161045b565b600480547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8416908102919091179091556040519081527f521671714dd36d366adf3fe2efec91d3f58a3131aad68e268821d8144b5d0845906020015b60405180910390a150565b6000806114d7611647565b90504267ffffffffffffffff808216908316116114f75760009250505090565b6115018183611cc6565b9250505090565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517ff935763cc7c57ee8ed6318ed71e756cca0731294c9f46ff5b386f36d6ff1417a90600090a250565b60008163ffffffff16116115db5760405162461bcd60e51b815260206004820152602a60248201527f44726177426561636f6e2f626561636f6e2d706572696f642d6772656174657260448201527f2d7468616e2d7a65726f00000000000000000000000000000000000000000000606482015260840161045b565b600480547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff16600160c01b63ffffffff8416908102919091179091556040519081527f4727494dbd863e2084366f539d6ec569aaf7ab78582a34f006f004266777cd19906020016114c1565b60045460055460009161040591600160c01b90910463ffffffff169067ffffffffffffffff16611c25565b6004546000906001600160a01b039081169083166116f85760405162461bcd60e51b815260206004820152602860248201527f44726177426561636f6e2f647261772d686973746f72792d6e6f742d7a65726f60448201527f2d61646472657373000000000000000000000000000000000000000000000000606482015260840161045b565b806001600160a01b0316836001600160a01b031614156117805760405162461bcd60e51b815260206004820152602860248201527f44726177426561636f6e2f6578697374696e672d647261772d686973746f727960448201527f2d61646472657373000000000000000000000000000000000000000000000000606482015260840161045b565b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385169081179091556040517feb70b03fab908e126e5efc33f8dfd2731fa89c716282a86769025f8dd4a6c1e090600090a25090919050565b6000611830826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118c59092919063ffffffff16565b8051909150156118c0578080602001905181019061184e9190611a9f565b6118c05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161045b565b505050565b60606118d484846000856118dc565b949350505050565b6060824710156119545760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161045b565b843b6119a25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161045b565b600080866001600160a01b031685876040516119be9190611b78565b60006040518083038185875af1925050503d80600081146119fb576040519150601f19603f3d011682016040523d82523d6000602084013e611a00565b606091505b5091509150611a10828286611a1b565b979650505050505050565b60608315611a2a5750816111be565b825115611a3a5782518084602001fd5b8160405162461bcd60e51b815260040161045b9190611b94565b600060208284031215611a6657600080fd5b81356111be81611d4a565b60008060408385031215611a8457600080fd5b8251611a8f81611d4a565b6020939093015192949293505050565b600060208284031215611ab157600080fd5b815180151581146111be57600080fd5b600060208284031215611ad357600080fd5b5051919050565b600060208284031215611aec57600080fd5b81356111be81611d5f565b600060208284031215611b0957600080fd5b81516111be81611d5f565b60008060408385031215611b2757600080fd5b8251611b3281611d5f565b6020840151909250611b4381611d5f565b809150509250929050565b600060208284031215611b6057600080fd5b813567ffffffffffffffff811681146111be57600080fd5b60008251611b8a818460208701611cef565b9190910192915050565b6020815260008251806020840152611bb3816040850160208701611cef565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60008219821115611bf857611bf8611d1b565b500190565b600063ffffffff808316818516808303821115611c1c57611c1c611d1b565b01949350505050565b600067ffffffffffffffff808316818516808303821115611c1c57611c1c611d1b565b600067ffffffffffffffff80841680611c8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b92169190910492915050565b600067ffffffffffffffff80831681851681830481118215151615611cbd57611cbd611d1b565b02949350505050565b600067ffffffffffffffff83811690831681811015611ce757611ce7611d1b565b039392505050565b60005b83811015611d0a578181015183820152602001611cf2565b838111156112ef5750506000910152565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6001600160a01b0381168114610d1f57600080fd5b63ffffffff81168114610d1f57600080fdfea264697066735822122026a73622d5365663009325e2c371c24fd86c7196f0d37bc8dc1288bf1cf7bea564736f6c6343000806003344726177426561636f6e2f626561636f6e2d706572696f642d67726561746572", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c8063738bbea811610104578063a104fd79116100a2578063d1e7765711610071578063d1e77657146103b5578063e30c3978146103bd578063e4a75bb8146103ce578063f2fde38b146103d657600080fd5b8063a104fd791461036d578063a3ae35ab14610375578063ab70d49c14610388578063c57708c21461039b57600080fd5b80637f4296d7116100de5780637f4296d71461032e57806389c36f8e146103415780638da5cb5b14610349578063919bead01461035a57600080fd5b8063738bbea81461030d57806375e38f16146103155780637ce52b181461031d57600080fd5b80633e7a39081161017c5780634e71e0c81161014b5780634e71e0c8146102d45780635020ea56146102dc5780636bea5344146102ef578063715018a61461030557600080fd5b80633e7a39081461028a5780634019f2d61461029f578063412a616a146102c45780634aba4f6b146102cc57600080fd5b80631b5344a2116101b85780631b5344a2146102165780632a7ad6091461024d5780632ae168a61461025b57806339f92c301461026357600080fd5b80630996f6e1146101df5780630bdeecbd146101fc578063111070e414610206575b600080fd5b6101e76103e9565b60405190151581526020015b60405180910390f35b61020461040a565b005b60035463ffffffff1615156101e7565b60045474010000000000000000000000000000000000000000900463ffffffff165b60405163ffffffff90911681526020016101f3565b60035463ffffffff16610238565b6102046107b9565b60055467ffffffffffffffff165b60405167ffffffffffffffff90911681526020016101f3565b600454600160c01b900463ffffffff16610238565b6004546001600160a01b03165b6040516001600160a01b0390911681526020016101f3565b610204610aae565b6101e7610b78565b610204610c17565b6102046102ea366004611ada565b610ca5565b600354640100000000900463ffffffff16610238565b610204610d22565b6101e7610d97565b610271610e16565b6002546001600160a01b03166102ac565b61020461033c366004611a54565b610e20565b610271610e9a565b6000546001600160a01b03166102ac565b610204610368366004611ada565b610ec7565b610271610f41565b610271610383366004611b4e565b610f4b565b6102ac610396366004611a54565b610f7e565b60055468010000000000000000900463ffffffff16610238565b6101e7610ff2565b6001546001600160a01b03166102ac565b6101e7610ffc565b6102046103e4366004611a54565b61101e565b60006103f361115a565b8015610405575060035463ffffffff16155b905090565b60035463ffffffff166104645760405162461bcd60e51b815260206004820152601c60248201527f44726177426561636f6e2f726e672d6e6f742d7265717565737465640000000060448201526064015b60405180910390fd5b61046c610b78565b6104b85760405162461bcd60e51b815260206004820152601b60248201527f44726177426561636f6e2f726e672d6e6f742d636f6d706c6574650000000000604482015260640161045b565b6002546003546040517f9d2a5f9800000000000000000000000000000000000000000000000000000000815263ffffffff90911660048201526000916001600160a01b031690639d2a5f9890602401602060405180830381600087803b15801561052157600080fd5b505af1158015610535573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105599190611ac1565b60055460045491925063ffffffff68010000000000000000820481169267ffffffffffffffff90921691600160c01b90041660006105944290565b6040805160a08101825287815263ffffffff8781166020830190815260035468010000000000000000900467ffffffffffffffff90811684860190815289821660608601908152898516608087019081526004805498517f089eb925000000000000000000000000000000000000000000000000000000008152885191810191909152945186166024860152915183166044850152519091166064830152519091166084820152929350916001600160a01b039091169063089eb9259060a401602060405180830381600087803b15801561066e57600080fd5b505af1158015610682573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a69190611af7565b5060006106b4858585611180565b6005805467ffffffffffffffff191667ffffffffffffffff831617905590506106de866001611bfd565b6005805463ffffffff9290921668010000000000000000027fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff909216919091179055600380547fffffffffffffffffffffffffffffffff000000000000000000000000000000001690556040518781527f13f646a3648ee5b5a0e8d6bc3d2d623fddf38fa7c8c5dfdbdbe6a913112edc6c9060200160405180910390a160405167ffffffffffffffff8216907f9e5f7e6ac833c4735b5548bbeec59dac4d413789aa351fbe11a654dac0c4306c90600090a250505050505050565b6107c161115a565b6108335760405162461bcd60e51b815260206004820152602160248201527f44726177426561636f6e2f626561636f6e2d706572696f642d6e6f742d6f766560448201527f7200000000000000000000000000000000000000000000000000000000000000606482015260840161045b565b60035463ffffffff16156108895760405162461bcd60e51b815260206004820181905260248201527f44726177426561636f6e2f726e672d616c72656164792d726571756573746564604482015260640161045b565b600254604080517f0d37b537000000000000000000000000000000000000000000000000000000008152815160009384936001600160a01b0390911692630d37b5379260048083019392829003018186803b1580156108e757600080fd5b505afa1580156108fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091f9190611a71565b90925090506001600160a01b0382161580159061093c5750600081115b1561095b5760025461095b906001600160a01b038481169116836111c5565b600254604080517f8678a7b2000000000000000000000000000000000000000000000000000000008152815160009384936001600160a01b0390911692638678a7b2926004808301939282900301818787803b1580156109ba57600080fd5b505af11580156109ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f29190611b14565b6003805463ffffffff8084166401000000000267ffffffffffffffff19909216908516171790559092509050610a254290565b6003805467ffffffffffffffff9290921668010000000000000000027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff90921691909117905560405163ffffffff82811682528316907f0de3a7af7d3c2126e4fb96a7065b39f8bb17e3b9111c092e11236942fb38ca619060200160405180910390a250505050565b610ab6610d97565b610b025760405162461bcd60e51b815260206004820152601b60248201527f44726177426561636f6e2f726e672d6e6f742d74696d65646f75740000000000604482015260640161045b565b600380547fffffffffffffffffffffffffffffffff00000000000000000000000000000000811690915560405163ffffffff640100000000830481168083529216919082907f67638a3a7093a89cc6046dca58aa93d6343e30847e8f84fc3759d9d4a3e6e38b9060200160405180910390a25050565b6002546003546040517f3a19b9bc00000000000000000000000000000000000000000000000000000000815263ffffffff90911660048201526000916001600160a01b031690633a19b9bc9060240160206040518083038186803b158015610bdf57600080fd5b505afa158015610bf3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104059190611a9f565b6001546001600160a01b03163314610c715760405162461bcd60e51b815260206004820152601f60248201527f4f776e61626c652f63616c6c65722d6e6f742d70656e64696e674f776e657200604482015260640161045b565b600154610c86906001600160a01b03166112f5565b6001805473ffffffffffffffffffffffffffffffffffffffff19169055565b33610cb86000546001600160a01b031690565b6001600160a01b031614610d0e5760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161045b565b610d16611352565b610d1f816113cc565b50565b33610d356000546001600160a01b031690565b6001600160a01b031614610d8b5760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161045b565b610d9560006112f5565b565b60035460009068010000000000000000900467ffffffffffffffff16610dbd5750600090565b4260035460045467ffffffffffffffff92831692610e0692680100000000000000009004169074010000000000000000000000000000000000000000900463ffffffff16611c25565b67ffffffffffffffff1610905090565b60006104056114cc565b33610e336000546001600160a01b031690565b6001600160a01b031614610e895760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161045b565b610e91611352565b610d1f81611508565b6005546004546000916104059167ffffffffffffffff90911690600160c01b900463ffffffff1642611180565b33610eda6000546001600160a01b031690565b6001600160a01b031614610f305760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161045b565b610f38611352565b610d1f8161155f565b6000610405611647565b600554600454600091610f789167ffffffffffffffff90911690600160c01b900463ffffffff1684611180565b92915050565b600033610f936000546001600160a01b031690565b6001600160a01b031614610fe95760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161045b565b610f7882611672565b600061040561115a565b600061100f60035463ffffffff16151590565b80156104055750610405610b78565b336110316000546001600160a01b031690565b6001600160a01b0316146110875760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e65720000000000000000604482015260640161045b565b6001600160a01b0381166111035760405162461bcd60e51b815260206004820152602560248201527f4f776e61626c652f70656e64696e674f776e65722d6e6f742d7a65726f2d616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161045b565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f239a2ddded15777fa246aed5f7e1a9bc69a39d4eb4a397034d1d85766cca7d4c90600090a250565b60004267ffffffffffffffff1661116f611647565b67ffffffffffffffff161115905090565b60008063ffffffff84166111948685611cc6565b61119e9190611c48565b90506111b063ffffffff851682611c96565b6111ba9086611c25565b9150505b9392505050565b6040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e9060440160206040518083038186803b15801561122a57600080fd5b505afa15801561123e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112629190611ac1565b61126c9190611be5565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790529091506112ef9085906117db565b50505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6003544390640100000000900463ffffffff1615806113805750600354640100000000900463ffffffff1681105b610d1f5760405162461bcd60e51b815260206004820152601860248201527f44726177426561636f6e2f726e672d696e2d666c696768740000000000000000604482015260640161045b565b603c8163ffffffff16116114485760405162461bcd60e51b815260206004820152602160248201527f44726177426561636f6e2f726e672d74696d656f75742d67742d36302d73656360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161045b565b600480547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8416908102919091179091556040519081527f521671714dd36d366adf3fe2efec91d3f58a3131aad68e268821d8144b5d0845906020015b60405180910390a150565b6000806114d7611647565b90504267ffffffffffffffff808216908316116114f75760009250505090565b6115018183611cc6565b9250505090565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517ff935763cc7c57ee8ed6318ed71e756cca0731294c9f46ff5b386f36d6ff1417a90600090a250565b60008163ffffffff16116115db5760405162461bcd60e51b815260206004820152602a60248201527f44726177426561636f6e2f626561636f6e2d706572696f642d6772656174657260448201527f2d7468616e2d7a65726f00000000000000000000000000000000000000000000606482015260840161045b565b600480547fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff16600160c01b63ffffffff8416908102919091179091556040519081527f4727494dbd863e2084366f539d6ec569aaf7ab78582a34f006f004266777cd19906020016114c1565b60045460055460009161040591600160c01b90910463ffffffff169067ffffffffffffffff16611c25565b6004546000906001600160a01b039081169083166116f85760405162461bcd60e51b815260206004820152602860248201527f44726177426561636f6e2f647261772d686973746f72792d6e6f742d7a65726f60448201527f2d61646472657373000000000000000000000000000000000000000000000000606482015260840161045b565b806001600160a01b0316836001600160a01b031614156117805760405162461bcd60e51b815260206004820152602860248201527f44726177426561636f6e2f6578697374696e672d647261772d686973746f727960448201527f2d61646472657373000000000000000000000000000000000000000000000000606482015260840161045b565b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385169081179091556040517feb70b03fab908e126e5efc33f8dfd2731fa89c716282a86769025f8dd4a6c1e090600090a25090919050565b6000611830826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118c59092919063ffffffff16565b8051909150156118c0578080602001905181019061184e9190611a9f565b6118c05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161045b565b505050565b60606118d484846000856118dc565b949350505050565b6060824710156119545760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161045b565b843b6119a25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161045b565b600080866001600160a01b031685876040516119be9190611b78565b60006040518083038185875af1925050503d80600081146119fb576040519150601f19603f3d011682016040523d82523d6000602084013e611a00565b606091505b5091509150611a10828286611a1b565b979650505050505050565b60608315611a2a5750816111be565b825115611a3a5782518084602001fd5b8160405162461bcd60e51b815260040161045b9190611b94565b600060208284031215611a6657600080fd5b81356111be81611d4a565b60008060408385031215611a8457600080fd5b8251611a8f81611d4a565b6020939093015192949293505050565b600060208284031215611ab157600080fd5b815180151581146111be57600080fd5b600060208284031215611ad357600080fd5b5051919050565b600060208284031215611aec57600080fd5b81356111be81611d5f565b600060208284031215611b0957600080fd5b81516111be81611d5f565b60008060408385031215611b2757600080fd5b8251611b3281611d5f565b6020840151909250611b4381611d5f565b809150509250929050565b600060208284031215611b6057600080fd5b813567ffffffffffffffff811681146111be57600080fd5b60008251611b8a818460208701611cef565b9190910192915050565b6020815260008251806020840152611bb3816040850160208701611cef565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60008219821115611bf857611bf8611d1b565b500190565b600063ffffffff808316818516808303821115611c1c57611c1c611d1b565b01949350505050565b600067ffffffffffffffff808316818516808303821115611c1c57611c1c611d1b565b600067ffffffffffffffff80841680611c8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b92169190910492915050565b600067ffffffffffffffff80831681851681830481118215151615611cbd57611cbd611d1b565b02949350505050565b600067ffffffffffffffff83811690831681811015611ce757611ce7611d1b565b039392505050565b60005b83811015611d0a578181015183820152602001611cf2565b838111156112ef5750506000910152565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6001600160a01b0381168114610d1f57600080fd5b63ffffffff81168114610d1f57600080fdfea264697066735822122026a73622d5365663009325e2c371c24fd86c7196f0d37bc8dc1288bf1cf7bea564736f6c63430008060033", + "devdoc": { + "author": "PoolTogether Inc Team", + "events": { + "Deployed(uint32,uint64)": { + "params": { + "beaconPeriodStartedAt": "Timestamp when beacon period starts.", + "nextDrawId": "Draw ID at which the DrawBeacon should start. Can't be inferior to 1." + } + } + }, + "kind": "dev", + "methods": { + "beaconPeriodEndAt()": { + "returns": { + "_0": "The timestamp at which the beacon period ends." + } + }, + "beaconPeriodRemainingSeconds()": { + "returns": { + "_0": "The number of seconds remaining until the beacon period can be complete." + } + }, + "calculateNextBeaconPeriodStartTime(uint64)": { + "params": { + "time": "The timestamp to use as the current time" + }, + "returns": { + "_0": "The timestamp at which the next beacon period would start" + } + }, + "calculateNextBeaconPeriodStartTimeFromCurrentTime()": { + "returns": { + "_0": "The next beacon period start time" + } + }, + "canCompleteDraw()": { + "returns": { + "_0": "True if a Draw can be completed, false otherwise." + } + }, + "canStartDraw()": { + "returns": { + "_0": "True if a Draw can be started, false otherwise." + } + }, + "claimOwnership()": { + "details": "This function is only callable by the `_pendingOwner`." + }, + "constructor": { + "params": { + "_beaconPeriodSeconds": "The duration of the beacon period in seconds", + "_beaconPeriodStart": "The starting timestamp of the beacon period.", + "_drawBuffer": "The address of the draw buffer to push draws to", + "_nextDrawId": "Draw ID at which the DrawBeacon should start. Can't be inferior to 1.", + "_owner": "Address of the DrawBeacon owner", + "_rng": "The RNG service to use" + } + }, + "getLastRngLockBlock()": { + "returns": { + "_0": "The block number that the RNG request is locked to" + } + }, + "getLastRngRequestId()": { + "returns": { + "_0": "The current Request ID" + } + }, + "isBeaconPeriodOver()": { + "returns": { + "_0": "True if the beacon period is over, false otherwise" + } + }, + "isRngCompleted()": { + "returns": { + "_0": "True if a random number request has completed, false otherwise." + } + }, + "isRngRequested()": { + "returns": { + "_0": "True if a random number has been requested, false otherwise." + } + }, + "isRngTimedOut()": { + "returns": { + "_0": "True if a random number request has timed out, false otherwise." + } + }, + "pendingOwner()": { + "returns": { + "_0": "Current `_pendingOwner` address." + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setBeaconPeriodSeconds(uint32)": { + "params": { + "beaconPeriodSeconds": "The new beacon period in seconds. Must be greater than zero." + } + }, + "setDrawBuffer(address)": { + "details": "All subsequent Draw requests/completions will be pushed to the new DrawBuffer.", + "params": { + "newDrawBuffer": "DrawBuffer address" + }, + "returns": { + "_0": "DrawBuffer" + } + }, + "setRngService(address)": { + "params": { + "rngService": "The address of the new RNG service interface" + } + }, + "setRngTimeout(uint32)": { + "params": { + "rngTimeout": "The RNG request timeout in seconds." + } + }, + "startDraw()": { + "details": "The RNG-Request-Fee is expected to be held within this contract before calling this function" + }, + "transferOwnership(address)": { + "params": { + "_newOwner": "Address to transfer ownership to." + } + } + }, + "stateVariables": { + "nextDrawId": { + "details": "Starts at 1. This way we know that no Draw has been recorded at 0." + }, + "rngTimeout": { + "details": "If the rng completes the award can still be cancelled." + } + }, + "title": "PoolTogether V4 DrawBeacon", + "version": 1 + }, + "userdoc": { + "events": { + "BeaconPeriodSecondsUpdated(uint32)": { + "notice": "Emit when the drawPeriodSeconds is set." + }, + "BeaconPeriodStarted(uint64)": { + "notice": "Emit when a draw has opened." + }, + "Deployed(uint32,uint64)": { + "notice": "Emit when the DrawBeacon is deployed." + }, + "DrawBufferUpdated(address)": { + "notice": "Emit when a new DrawBuffer has been set." + }, + "DrawCancelled(uint32,uint32)": { + "notice": "Emit when a draw has been cancelled." + }, + "DrawCompleted(uint256)": { + "notice": "Emit when a draw has been completed." + }, + "DrawStarted(uint32,uint32)": { + "notice": "Emit when a draw has started." + }, + "RngServiceUpdated(address)": { + "notice": "Emit when a RNG service address is set." + }, + "RngTimeoutSet(uint32)": { + "notice": "Emit when a draw timeout param is set." + } + }, + "kind": "user", + "methods": { + "beaconPeriodEndAt()": { + "notice": "Returns the timestamp at which the beacon period ends" + }, + "beaconPeriodRemainingSeconds()": { + "notice": "Returns the number of seconds remaining until the beacon period can be complete." + }, + "calculateNextBeaconPeriodStartTime(uint64)": { + "notice": "Calculates when the next beacon period will start." + }, + "calculateNextBeaconPeriodStartTimeFromCurrentTime()": { + "notice": "Calculates the next beacon start time, assuming all beacon periods have occurred between the last and now." + }, + "canCompleteDraw()": { + "notice": "Returns whether a Draw can be completed." + }, + "canStartDraw()": { + "notice": "Returns whether a Draw can be started." + }, + "cancelDraw()": { + "notice": "Can be called by anyone to cancel the draw request if the RNG has timed out." + }, + "claimOwnership()": { + "notice": "Allows the `_pendingOwner` address to finalize the transfer." + }, + "completeDraw()": { + "notice": "Completes the Draw (RNG) request and pushes a Draw onto DrawBuffer." + }, + "constructor": { + "notice": "Deploy the DrawBeacon smart contract." + }, + "getLastRngLockBlock()": { + "notice": "Returns the block number that the current RNG request has been locked to." + }, + "getLastRngRequestId()": { + "notice": "Returns the current RNG Request ID." + }, + "isBeaconPeriodOver()": { + "notice": "Returns whether the beacon period is over" + }, + "isRngCompleted()": { + "notice": "Returns whether the random number request has completed." + }, + "isRngRequested()": { + "notice": "Returns whether a random number has been requested" + }, + "isRngTimedOut()": { + "notice": "Returns whether the random number request has timed out." + }, + "owner()": { + "notice": "Returns the address of the current owner." + }, + "pendingOwner()": { + "notice": "Gets current `_pendingOwner`." + }, + "renounceOwnership()": { + "notice": "Renounce ownership of the contract." + }, + "setBeaconPeriodSeconds(uint32)": { + "notice": "Allows the owner to set the beacon period in seconds." + }, + "setDrawBuffer(address)": { + "notice": "Set global DrawBuffer variable." + }, + "setRngService(address)": { + "notice": "Sets the RNG service that the Prize Strategy is connected to" + }, + "setRngTimeout(uint32)": { + "notice": "Allows the owner to set the RNG request timeout in seconds. This is the time that must elapsed before the RNG request can be cancelled and the pool unlocked." + }, + "startDraw()": { + "notice": "Starts the Draw process by starting random number request. The previous beacon period must have ended." + }, + "transferOwnership(address)": { + "notice": "Allows current owner to set the `_pendingOwner` address." + } + }, + "notice": "Manages RNG (random number generator) requests and pushing Draws onto DrawBuffer. The DrawBeacon has 3 major actions for requesting a random number: start, cancel and complete. To create a new Draw, the user requests a new random number from the RNG service. When the random number is available, the user can create the draw using the create() method which will push the draw onto the DrawBuffer. If the RNG service fails to deliver a rng, when the request timeout elapses, the user can cancel the request.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 5205, + "contract": "@pooltogether/v4-core/contracts/DrawBeacon.sol:DrawBeacon", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 5207, + "contract": "@pooltogether/v4-core/contracts/DrawBeacon.sol:DrawBeacon", + "label": "_pendingOwner", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 6038, + "contract": "@pooltogether/v4-core/contracts/DrawBeacon.sol:DrawBeacon", + "label": "rng", + "offset": 0, + "slot": "2", + "type": "t_contract(RNGInterface)5835" + }, + { + "astId": 6042, + "contract": "@pooltogether/v4-core/contracts/DrawBeacon.sol:DrawBeacon", + "label": "rngRequest", + "offset": 0, + "slot": "3", + "type": "t_struct(RngRequest)6065_storage" + }, + { + "astId": 6046, + "contract": "@pooltogether/v4-core/contracts/DrawBeacon.sol:DrawBeacon", + "label": "drawBuffer", + "offset": 0, + "slot": "4", + "type": "t_contract(IDrawBuffer)10930" + }, + { + "astId": 6049, + "contract": "@pooltogether/v4-core/contracts/DrawBeacon.sol:DrawBeacon", + "label": "rngTimeout", + "offset": 20, + "slot": "4", + "type": "t_uint32" + }, + { + "astId": 6052, + "contract": "@pooltogether/v4-core/contracts/DrawBeacon.sol:DrawBeacon", + "label": "beaconPeriodSeconds", + "offset": 24, + "slot": "4", + "type": "t_uint32" + }, + { + "astId": 6055, + "contract": "@pooltogether/v4-core/contracts/DrawBeacon.sol:DrawBeacon", + "label": "beaconPeriodStartedAt", + "offset": 0, + "slot": "5", + "type": "t_uint64" + }, + { + "astId": 6058, + "contract": "@pooltogether/v4-core/contracts/DrawBeacon.sol:DrawBeacon", + "label": "nextDrawId", + "offset": 8, + "slot": "5", + "type": "t_uint32" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_contract(IDrawBuffer)10930": { + "encoding": "inplace", + "label": "contract IDrawBuffer", + "numberOfBytes": "20" + }, + "t_contract(RNGInterface)5835": { + "encoding": "inplace", + "label": "contract RNGInterface", + "numberOfBytes": "20" + }, + "t_struct(RngRequest)6065_storage": { + "encoding": "inplace", + "label": "struct DrawBeacon.RngRequest", + "members": [ + { + "astId": 6060, + "contract": "@pooltogether/v4-core/contracts/DrawBeacon.sol:DrawBeacon", + "label": "id", + "offset": 0, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 6062, + "contract": "@pooltogether/v4-core/contracts/DrawBeacon.sol:DrawBeacon", + "label": "lockBlock", + "offset": 4, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 6064, + "contract": "@pooltogether/v4-core/contracts/DrawBeacon.sol:DrawBeacon", + "label": "requestedAt", + "offset": 8, + "slot": "0", + "type": "t_uint64" + } + ], + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/deployments/polygon/RNGChainlinkV2.json b/deployments/polygon/RNGChainlinkV2.json new file mode 100644 index 0000000..f85cd69 --- /dev/null +++ b/deployments/polygon/RNGChainlinkV2.json @@ -0,0 +1,884 @@ +{ + "address": "0x7402d9f36904894273B31dD0d998D826c833EF93", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "contract VRFCoordinatorV2Interface", + "name": "_vrfCoordinator", + "type": "address" + }, + { + "internalType": "uint64", + "name": "_subscriptionId", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_keyHash", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "have", + "type": "address" + }, + { + "internalType": "address", + "name": "want", + "type": "address" + } + ], + "name": "OnlyCoordinatorCanFulfill", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + } + ], + "name": "KeyHashSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newManager", + "type": "address" + } + ], + "name": "ManagerTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "pendingOwner", + "type": "address" + } + ], + "name": "OwnershipOffered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "requestId", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "randomNumber", + "type": "uint256" + } + ], + "name": "RandomNumberCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "requestId", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RandomNumberRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "SubscriptionIdSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VRFCoordinatorV2Interface", + "name": "vrfCoordinator", + "type": "address" + } + ], + "name": "VrfCoordinatorSet", + "type": "event" + }, + { + "inputs": [], + "name": "claimOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getKeyHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastRequestId", + "outputs": [ + { + "internalType": "uint32", + "name": "requestId", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRequestFee", + "outputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "requestFee", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getSubscriptionId", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVrfCoordinator", + "outputs": [ + { + "internalType": "contract VRFCoordinatorV2Interface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_internalRequestId", + "type": "uint32" + } + ], + "name": "isRequestComplete", + "outputs": [ + { + "internalType": "bool", + "name": "isCompleted", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_internalRequestId", + "type": "uint32" + } + ], + "name": "randomNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "randomNum", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "randomWords", + "type": "uint256[]" + } + ], + "name": "rawFulfillRandomWords", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "requestRandomNumber", + "outputs": [ + { + "internalType": "uint32", + "name": "requestId", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "lockBlock", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_keyHash", + "type": "bytes32" + } + ], + "name": "setKeyhash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_subscriptionId", + "type": "uint64" + } + ], + "name": "setSubscriptionId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x171aeb693890108f793244616166dbf74e5807fbaa304eb0667290717bb00180", + "receipt": { + "to": null, + "from": "0x4D40eb12430A57965cEe3015348d490C6156dF20", + "contractAddress": "0x7402d9f36904894273B31dD0d998D826c833EF93", + "transactionIndex": 35, + "gasUsed": "974308", + "logsBloom": "0x00000000000000000000000000000000000001000000000000800000010000000000000000001000000000000040008000008000020000000000000000000000000000000000000000020000000000800001000000000002000100020000000000000000020000000000000000000800000080000000000880000000000000400000000000000002000000000000000000000000000000000000000000000000200000000000000000000000000000000400000000000000000000000000014000000000000000000001000000000000000004000000001000100000000060000000000000000000000000000000000008000000002000000000000021100000", + "blockHash": "0x5e60a959b16819c95e2a8bb93cce609a25b9b3b6297152fd4a20e1301b8a0e97", + "transactionHash": "0x171aeb693890108f793244616166dbf74e5807fbaa304eb0667290717bb00180", + "logs": [ + { + "transactionIndex": 35, + "blockNumber": 36229428, + "transactionHash": "0x171aeb693890108f793244616166dbf74e5807fbaa304eb0667290717bb00180", + "address": "0x7402d9f36904894273B31dD0d998D826c833EF93", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004d40eb12430a57965cee3015348d490c6156df20" + ], + "data": "0x", + "logIndex": 87, + "blockHash": "0x5e60a959b16819c95e2a8bb93cce609a25b9b3b6297152fd4a20e1301b8a0e97" + }, + { + "transactionIndex": 35, + "blockNumber": 36229428, + "transactionHash": "0x171aeb693890108f793244616166dbf74e5807fbaa304eb0667290717bb00180", + "address": "0x7402d9f36904894273B31dD0d998D826c833EF93", + "topics": [ + "0x4cc41e06d3d0588be9be0e1469ba1934c4bd1cb8f4f70adf2aa31f4b92134b27", + "0x000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067" + ], + "data": "0x", + "logIndex": 88, + "blockHash": "0x5e60a959b16819c95e2a8bb93cce609a25b9b3b6297152fd4a20e1301b8a0e97" + }, + { + "transactionIndex": 35, + "blockNumber": 36229428, + "transactionHash": "0x171aeb693890108f793244616166dbf74e5807fbaa304eb0667290717bb00180", + "address": "0x7402d9f36904894273B31dD0d998D826c833EF93", + "topics": [ + "0x68de96e24c66c14c012b5bd342251abc26a6003eaa438002bfe530f28ca63fed" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000001d8", + "logIndex": 89, + "blockHash": "0x5e60a959b16819c95e2a8bb93cce609a25b9b3b6297152fd4a20e1301b8a0e97" + }, + { + "transactionIndex": 35, + "blockNumber": 36229428, + "transactionHash": "0x171aeb693890108f793244616166dbf74e5807fbaa304eb0667290717bb00180", + "address": "0x7402d9f36904894273B31dD0d998D826c833EF93", + "topics": [ + "0xd013f86c8346660ebf421351882cd1b3c2f91883092df1800264c656b0db0cc6" + ], + "data": "0xcc294a196eeeb44da2888d17c0625cc88d70d9760a69d58d853ba6581a9ab0cd", + "logIndex": 90, + "blockHash": "0x5e60a959b16819c95e2a8bb93cce609a25b9b3b6297152fd4a20e1301b8a0e97" + }, + { + "transactionIndex": 35, + "blockNumber": 36229428, + "transactionHash": "0x171aeb693890108f793244616166dbf74e5807fbaa304eb0667290717bb00180", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x0000000000000000000000004d40eb12430a57965cee3015348d490c6156df20", + "0x000000000000000000000000794e44d1334a56fea7f4df12633b88820d0c5888" + ], + "data": "0x000000000000000000000000000000000000000000000000009711716a6506f400000000000000000000000000000000000000000000000020d00297bd246c82000000000000000000000000000000000000000000000190098d1edd0ffa976e0000000000000000000000000000000000000000000000002038f12652bf658e0000000000000000000000000000000000000000000001900a24304e7a5f9e62", + "logIndex": 91, + "blockHash": "0x5e60a959b16819c95e2a8bb93cce609a25b9b3b6297152fd4a20e1301b8a0e97" + } + ], + "blockNumber": 36229428, + "cumulativeGasUsed": "5646553", + "status": 1, + "byzantium": true + }, + "args": [ + "0x4D40eb12430A57965cEe3015348d490C6156dF20", + "0xAE975071Be8F8eE67addBC1A82488F1C24858067", + 472, + "0xcc294a196eeeb44da2888d17c0625cc88d70d9760a69d58d853ba6581a9ab0cd" + ], + "numDeployments": 1, + "solcInputHash": "81bc9ae0cb2caeb2744ac5c81556a380", + "metadata": "{\"compiler\":{\"version\":\"0.8.6+commit.11564f7e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"contract VRFCoordinatorV2Interface\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"keyHash\",\"type\":\"bytes32\"}],\"name\":\"KeyHashSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"ManagerTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pendingOwner\",\"type\":\"address\"}],\"name\":\"OwnershipOffered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"requestId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"randomNumber\",\"type\":\"uint256\"}],\"name\":\"RandomNumberCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"requestId\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RandomNumberRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"SubscriptionIdSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract VRFCoordinatorV2Interface\",\"name\":\"vrfCoordinator\",\"type\":\"address\"}],\"name\":\"VrfCoordinatorSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"claimOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getKeyHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastRequestId\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"requestId\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRequestFee\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requestFee\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSubscriptionId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVrfCoordinator\",\"outputs\":[{\"internalType\":\"contract VRFCoordinatorV2Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_internalRequestId\",\"type\":\"uint32\"}],\"name\":\"isRequestComplete\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isCompleted\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_internalRequestId\",\"type\":\"uint32\"}],\"name\":\"randomNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"randomNum\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"requestRandomNumber\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"requestId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"lockBlock\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"}],\"name\":\"setKeyhash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_subscriptionId\",\"type\":\"uint64\"}],\"name\":\"setSubscriptionId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"KeyHashSet(bytes32)\":{\"params\":{\"keyHash\":\"Chainlink VRF keyHash\"}},\"SubscriptionIdSet(uint64)\":{\"params\":{\"subscriptionId\":\"Chainlink VRF subscription id\"}},\"VrfCoordinatorSet(address)\":{\"params\":{\"vrfCoordinator\":\"Address of the VRF Coordinator\"}}},\"kind\":\"dev\",\"methods\":{\"claimOwnership()\":{\"details\":\"This function is only callable by the `_pendingOwner`.\"},\"constructor\":{\"params\":{\"_keyHash\":\"Hash of the public key used to verify the VRF proof\",\"_owner\":\"Owner of the contract\",\"_subscriptionId\":\"Chainlink VRF subscription id\",\"_vrfCoordinator\":\"Address of the VRF Coordinator\"}},\"getKeyHash()\":{\"returns\":{\"_0\":\"bytes32 Chainlink VRF keyHash\"}},\"getLastRequestId()\":{\"returns\":{\"requestId\":\"The last request id used in the last request\"}},\"getRequestFee()\":{\"returns\":{\"feeToken\":\"The address of the token that is used to pay fees\",\"requestFee\":\"The fee required to be paid to make a request\"}},\"getSubscriptionId()\":{\"returns\":{\"_0\":\"uint64 Chainlink VRF subscription id\"}},\"getVrfCoordinator()\":{\"returns\":{\"_0\":\"address Chainlink VRF coordinator address\"}},\"isRequestComplete(uint32)\":{\"details\":\"For time-delayed requests, this function is used to check/confirm completion\",\"params\":{\"requestId\":\"The ID of the request used to get the results of the RNG service\"},\"returns\":{\"isCompleted\":\"True if the request has completed and a random number is available, false otherwise\"}},\"manager()\":{\"returns\":{\"_0\":\"Current `_manager` address.\"}},\"pendingOwner()\":{\"returns\":{\"_0\":\"Current `_pendingOwner` address.\"}},\"randomNumber(uint32)\":{\"params\":{\"requestId\":\"The ID of the request used to get the results of the RNG service\"},\"returns\":{\"randomNum\":\"The random number\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"requestRandomNumber()\":{\"details\":\"Some services will complete the request immediately, others may have a time-delaySome services require payment in the form of a token, such as $LINK for Chainlink VRF\",\"returns\":{\"lockBlock\":\"The block number at which the RNG service will start generating time-delayed randomness. The calling contract should \\\"lock\\\" all activity until the result is available via the `requestId`\",\"requestId\":\"The ID of the request used to get the results of the RNG service\"}},\"setKeyhash(bytes32)\":{\"details\":\"This function is only callable by the owner.\",\"params\":{\"keyHash\":\"Chainlink VRF keyHash\"}},\"setManager(address)\":{\"details\":\"Throws if called by any account other than the owner.\",\"params\":{\"_newManager\":\"New _manager address.\"},\"returns\":{\"_0\":\"Boolean to indicate if the operation was successful or not.\"}},\"setSubscriptionId(uint64)\":{\"details\":\"This function is only callable by the owner.\",\"params\":{\"subscriptionId\":\"Chainlink VRF subscription id\"}},\"transferOwnership(address)\":{\"params\":{\"_newOwner\":\"Address to transfer ownership to.\"}}},\"stateVariables\":{\"chainlinkRequestIds\":{\"details\":\"A mapping from Chainlink request ids to internal request ids\"},\"keyHash\":{\"details\":\"Hash of the public key used to verify the VRF proof\"},\"randomNumbers\":{\"details\":\"A list of random numbers from past requests mapped by request id\"},\"requestCounter\":{\"details\":\"A counter for the number of requests made used for request ids\"},\"requestLockBlock\":{\"details\":\"A list of blocks to be locked at based on past requests mapped by request id\"},\"subscriptionId\":{\"details\":\"Chainlink VRF subscription id\"},\"vrfCoordinator\":{\"details\":\"Reference to the VRFCoordinatorV2 deployed contract\"}},\"version\":1},\"userdoc\":{\"events\":{\"KeyHashSet(bytes32)\":{\"notice\":\"Emitted when the Chainlink VRF keyHash is set\"},\"RandomNumberCompleted(uint32,uint256)\":{\"notice\":\"Emitted when an existing request for a random number has been completed\"},\"RandomNumberRequested(uint32,address)\":{\"notice\":\"Emitted when a new request for a random number has been submitted\"},\"SubscriptionIdSet(uint64)\":{\"notice\":\"Emitted when the Chainlink VRF subscription id is set\"},\"VrfCoordinatorSet(address)\":{\"notice\":\"Emitted when the Chainlink VRF Coordinator address is set\"}},\"kind\":\"user\",\"methods\":{\"claimOwnership()\":{\"notice\":\"Allows the `_pendingOwner` address to finalize the transfer.\"},\"constructor\":{\"notice\":\"Constructor of the contract\"},\"getKeyHash()\":{\"notice\":\"Get Chainlink VRF keyHash associated with this contract.\"},\"getLastRequestId()\":{\"notice\":\"Gets the last request id used by the RNG service\"},\"getRequestFee()\":{\"notice\":\"Gets the Fee for making a Request against an RNG service\"},\"getSubscriptionId()\":{\"notice\":\"Get Chainlink VRF subscription id associated with this contract.\"},\"getVrfCoordinator()\":{\"notice\":\"Get Chainlink VRF coordinator contract address associated with this contract.\"},\"isRequestComplete(uint32)\":{\"notice\":\"Checks if the request for randomness from the 3rd-party service has completed\"},\"manager()\":{\"notice\":\"Gets current `_manager`.\"},\"owner()\":{\"notice\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"notice\":\"Gets current `_pendingOwner`.\"},\"randomNumber(uint32)\":{\"notice\":\"Gets the random number produced by the 3rd-party service\"},\"renounceOwnership()\":{\"notice\":\"Renounce ownership of the contract.\"},\"requestRandomNumber()\":{\"notice\":\"Sends a request for a random number to the 3rd-party service\"},\"setKeyhash(bytes32)\":{\"notice\":\"Set Chainlink VRF keyHash.\"},\"setManager(address)\":{\"notice\":\"Set or change of manager.\"},\"setSubscriptionId(uint64)\":{\"notice\":\"Set Chainlink VRF subscription id associated with this contract.\"},\"transferOwnership(address)\":{\"notice\":\"Allows current owner to set the `_pendingOwner` address.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol\":\"RNGChainlinkV2\"},\"evmVersion\":\"berlin\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":2000},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/** ****************************************************************************\\n * @notice Interface for contracts using VRF randomness\\n * *****************************************************************************\\n * @dev PURPOSE\\n *\\n * @dev Reggie the Random Oracle (not his real job) wants to provide randomness\\n * @dev to Vera the verifier in such a way that Vera can be sure he's not\\n * @dev making his output up to suit himself. Reggie provides Vera a public key\\n * @dev to which he knows the secret key. Each time Vera provides a seed to\\n * @dev Reggie, he gives back a value which is computed completely\\n * @dev deterministically from the seed and the secret key.\\n *\\n * @dev Reggie provides a proof by which Vera can verify that the output was\\n * @dev correctly computed once Reggie tells it to her, but without that proof,\\n * @dev the output is indistinguishable to her from a uniform random sample\\n * @dev from the output space.\\n *\\n * @dev The purpose of this contract is to make it easy for unrelated contracts\\n * @dev to talk to Vera the verifier about the work Reggie is doing, to provide\\n * @dev simple access to a verifiable source of randomness. It ensures 2 things:\\n * @dev 1. The fulfillment came from the VRFCoordinator\\n * @dev 2. The consumer contract implements fulfillRandomWords.\\n * *****************************************************************************\\n * @dev USAGE\\n *\\n * @dev Calling contracts must inherit from VRFConsumerBase, and can\\n * @dev initialize VRFConsumerBase's attributes in their constructor as\\n * @dev shown:\\n *\\n * @dev contract VRFConsumer {\\n * @dev constructor(, address _vrfCoordinator, address _link)\\n * @dev VRFConsumerBase(_vrfCoordinator) public {\\n * @dev \\n * @dev }\\n * @dev }\\n *\\n * @dev The oracle will have given you an ID for the VRF keypair they have\\n * @dev committed to (let's call it keyHash). Create subscription, fund it\\n * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface\\n * @dev subscription management functions).\\n * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,\\n * @dev callbackGasLimit, numWords),\\n * @dev see (VRFCoordinatorInterface for a description of the arguments).\\n *\\n * @dev Once the VRFCoordinator has received and validated the oracle's response\\n * @dev to your request, it will call your contract's fulfillRandomWords method.\\n *\\n * @dev The randomness argument to fulfillRandomWords is a set of random words\\n * @dev generated from your requestId and the blockHash of the request.\\n *\\n * @dev If your contract could have concurrent requests open, you can use the\\n * @dev requestId returned from requestRandomWords to track which response is associated\\n * @dev with which randomness request.\\n * @dev See \\\"SECURITY CONSIDERATIONS\\\" for principles to keep in mind,\\n * @dev if your contract could have multiple requests in flight simultaneously.\\n *\\n * @dev Colliding `requestId`s are cryptographically impossible as long as seeds\\n * @dev differ.\\n *\\n * *****************************************************************************\\n * @dev SECURITY CONSIDERATIONS\\n *\\n * @dev A method with the ability to call your fulfillRandomness method directly\\n * @dev could spoof a VRF response with any random value, so it's critical that\\n * @dev it cannot be directly called by anything other than this base contract\\n * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).\\n *\\n * @dev For your users to trust that your contract's random behavior is free\\n * @dev from malicious interference, it's best if you can write it so that all\\n * @dev behaviors implied by a VRF response are executed *during* your\\n * @dev fulfillRandomness method. If your contract must store the response (or\\n * @dev anything derived from it) and use it later, you must ensure that any\\n * @dev user-significant behavior which depends on that stored value cannot be\\n * @dev manipulated by a subsequent VRF request.\\n *\\n * @dev Similarly, both miners and the VRF oracle itself have some influence\\n * @dev over the order in which VRF responses appear on the blockchain, so if\\n * @dev your contract could have multiple VRF requests in flight simultaneously,\\n * @dev you must ensure that the order in which the VRF responses arrive cannot\\n * @dev be used to manipulate your contract's user-significant behavior.\\n *\\n * @dev Since the block hash of the block which contains the requestRandomness\\n * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful\\n * @dev miner could, in principle, fork the blockchain to evict the block\\n * @dev containing the request, forcing the request to be included in a\\n * @dev different block with a different hash, and therefore a different input\\n * @dev to the VRF. However, such an attack would incur a substantial economic\\n * @dev cost. This cost scales with the number of blocks the VRF oracle waits\\n * @dev until it calls responds to a request. It is for this reason that\\n * @dev that you can signal to an oracle you'd like them to wait longer before\\n * @dev responding to the request (however this is not enforced in the contract\\n * @dev and so remains effective only in the case of unmodified oracle software).\\n */\\nabstract contract VRFConsumerBaseV2 {\\n error OnlyCoordinatorCanFulfill(address have, address want);\\n address private immutable vrfCoordinator;\\n\\n /**\\n * @param _vrfCoordinator address of VRFCoordinator contract\\n */\\n constructor(address _vrfCoordinator) {\\n vrfCoordinator = _vrfCoordinator;\\n }\\n\\n /**\\n * @notice fulfillRandomness handles the VRF response. Your contract must\\n * @notice implement it. See \\\"SECURITY CONSIDERATIONS\\\" above for important\\n * @notice principles to keep in mind when implementing your fulfillRandomness\\n * @notice method.\\n *\\n * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this\\n * @dev signature, and will call it once it has verified the proof\\n * @dev associated with the randomness. (It is triggered via a call to\\n * @dev rawFulfillRandomness, below.)\\n *\\n * @param requestId The Id initially returned by requestRandomness\\n * @param randomWords the VRF output expanded to the requested number of words\\n */\\n function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;\\n\\n // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF\\n // proof. rawFulfillRandomness then calls fulfillRandomness, after validating\\n // the origin of the call\\n function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {\\n if (msg.sender != vrfCoordinator) {\\n revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);\\n }\\n fulfillRandomWords(requestId, randomWords);\\n }\\n}\\n\",\"keccak256\":\"0xec8b7e3032e887dd0732d2a5f8552ddce64a99a81b0008ef0bcf6cad68a535fc\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface VRFCoordinatorV2Interface {\\n /**\\n * @notice Get configuration relevant for making requests\\n * @return minimumRequestConfirmations global min for request confirmations\\n * @return maxGasLimit global max for request gas limit\\n * @return s_provingKeyHashes list of registered key hashes\\n */\\n function getRequestConfig()\\n external\\n view\\n returns (\\n uint16,\\n uint32,\\n bytes32[] memory\\n );\\n\\n /**\\n * @notice Request a set of random words.\\n * @param keyHash - Corresponds to a particular oracle job which uses\\n * that key for generating the VRF proof. Different keyHash's have different gas price\\n * ceilings, so you can select a specific one to bound your maximum per request cost.\\n * @param subId - The ID of the VRF subscription. Must be funded\\n * with the minimum subscription balance required for the selected keyHash.\\n * @param minimumRequestConfirmations - How many blocks you'd like the\\n * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS\\n * for why you may want to request more. The acceptable range is\\n * [minimumRequestBlockConfirmations, 200].\\n * @param callbackGasLimit - How much gas you'd like to receive in your\\n * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords\\n * may be slightly less than this amount because of gas used calling the function\\n * (argument decoding etc.), so you may need to request slightly more than you expect\\n * to have inside fulfillRandomWords. The acceptable range is\\n * [0, maxGasLimit]\\n * @param numWords - The number of uint256 random values you'd like to receive\\n * in your fulfillRandomWords callback. Note these numbers are expanded in a\\n * secure way by the VRFCoordinator from a single random value supplied by the oracle.\\n * @return requestId - A unique identifier of the request. Can be used to match\\n * a request to a response in fulfillRandomWords.\\n */\\n function requestRandomWords(\\n bytes32 keyHash,\\n uint64 subId,\\n uint16 minimumRequestConfirmations,\\n uint32 callbackGasLimit,\\n uint32 numWords\\n ) external returns (uint256 requestId);\\n\\n /**\\n * @notice Create a VRF subscription.\\n * @return subId - A unique subscription id.\\n * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.\\n * @dev Note to fund the subscription, use transferAndCall. For example\\n * @dev LINKTOKEN.transferAndCall(\\n * @dev address(COORDINATOR),\\n * @dev amount,\\n * @dev abi.encode(subId));\\n */\\n function createSubscription() external returns (uint64 subId);\\n\\n /**\\n * @notice Get a VRF subscription.\\n * @param subId - ID of the subscription\\n * @return balance - LINK balance of the subscription in juels.\\n * @return reqCount - number of requests for this subscription, determines fee tier.\\n * @return owner - owner of the subscription.\\n * @return consumers - list of consumer address which are able to use this subscription.\\n */\\n function getSubscription(uint64 subId)\\n external\\n view\\n returns (\\n uint96 balance,\\n uint64 reqCount,\\n address owner,\\n address[] memory consumers\\n );\\n\\n /**\\n * @notice Request subscription owner transfer.\\n * @param subId - ID of the subscription\\n * @param newOwner - proposed new owner of the subscription\\n */\\n function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;\\n\\n /**\\n * @notice Request subscription owner transfer.\\n * @param subId - ID of the subscription\\n * @dev will revert if original owner of subId has\\n * not requested that msg.sender become the new owner.\\n */\\n function acceptSubscriptionOwnerTransfer(uint64 subId) external;\\n\\n /**\\n * @notice Add a consumer to a VRF subscription.\\n * @param subId - ID of the subscription\\n * @param consumer - New consumer which can use the subscription\\n */\\n function addConsumer(uint64 subId, address consumer) external;\\n\\n /**\\n * @notice Remove a consumer from a VRF subscription.\\n * @param subId - ID of the subscription\\n * @param consumer - Consumer to remove from the subscription\\n */\\n function removeConsumer(uint64 subId, address consumer) external;\\n\\n /**\\n * @notice Cancel a subscription\\n * @param subId - ID of the subscription\\n * @param to - Where to send the remaining LINK to\\n */\\n function cancelSubscription(uint64 subId, address to) external;\\n}\\n\",\"keccak256\":\"0xcb29ee50ee2b05441e4deebf8b4756a0feec4f5497e36b6a1ca320f7ce561802\",\"license\":\"MIT\"},\"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./Ownable.sol\\\";\\n\\n/**\\n * @title Abstract manageable contract that can be inherited by other contracts\\n * @notice Contract module based on Ownable which provides a basic access control mechanism, where\\n * there is an owner and a manager that can be granted exclusive access to specific functions.\\n *\\n * By default, the owner is the deployer of the contract.\\n *\\n * The owner account is set through a two steps process.\\n * 1. The current `owner` calls {transferOwnership} to set a `pendingOwner`\\n * 2. The `pendingOwner` calls {acceptOwnership} to accept the ownership transfer\\n *\\n * The manager account needs to be set using {setManager}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyManager`, which can be applied to your functions to restrict their use to\\n * the manager.\\n */\\nabstract contract Manageable is Ownable {\\n address private _manager;\\n\\n /**\\n * @dev Emitted when `_manager` has been changed.\\n * @param previousManager previous `_manager` address.\\n * @param newManager new `_manager` address.\\n */\\n event ManagerTransferred(address indexed previousManager, address indexed newManager);\\n\\n /* ============ External Functions ============ */\\n\\n /**\\n * @notice Gets current `_manager`.\\n * @return Current `_manager` address.\\n */\\n function manager() public view virtual returns (address) {\\n return _manager;\\n }\\n\\n /**\\n * @notice Set or change of manager.\\n * @dev Throws if called by any account other than the owner.\\n * @param _newManager New _manager address.\\n * @return Boolean to indicate if the operation was successful or not.\\n */\\n function setManager(address _newManager) external onlyOwner returns (bool) {\\n return _setManager(_newManager);\\n }\\n\\n /* ============ Internal Functions ============ */\\n\\n /**\\n * @notice Set or change of manager.\\n * @param _newManager New _manager address.\\n * @return Boolean to indicate if the operation was successful or not.\\n */\\n function _setManager(address _newManager) private returns (bool) {\\n address _previousManager = _manager;\\n\\n require(_newManager != _previousManager, \\\"Manageable/existing-manager-address\\\");\\n\\n _manager = _newManager;\\n\\n emit ManagerTransferred(_previousManager, _newManager);\\n return true;\\n }\\n\\n /* ============ Modifier Functions ============ */\\n\\n /**\\n * @dev Throws if called by any account other than the manager.\\n */\\n modifier onlyManager() {\\n require(manager() == msg.sender, \\\"Manageable/caller-not-manager\\\");\\n _;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the manager or the owner.\\n */\\n modifier onlyManagerOrOwner() {\\n require(manager() == msg.sender || owner() == msg.sender, \\\"Manageable/caller-not-manager-or-owner\\\");\\n _;\\n }\\n}\\n\",\"keccak256\":\"0xdd8ac008df192c6aa4df83e7037ab090970fda38e1f9fd712bc0ab5e0485fc04\",\"license\":\"GPL-3.0\"},\"@pooltogether/owner-manager-contracts/contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Abstract ownable contract that can be inherited by other contracts\\n * @notice Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner is the deployer of the contract.\\n *\\n * The owner account is set through a two steps process.\\n * 1. The current `owner` calls {transferOwnership} to set a `pendingOwner`\\n * 2. The `pendingOwner` calls {acceptOwnership} to accept the ownership transfer\\n *\\n * The manager account needs to be set using {setManager}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable {\\n address private _owner;\\n address private _pendingOwner;\\n\\n /**\\n * @dev Emitted when `_pendingOwner` has been changed.\\n * @param pendingOwner new `_pendingOwner` address.\\n */\\n event OwnershipOffered(address indexed pendingOwner);\\n\\n /**\\n * @dev Emitted when `_owner` has been changed.\\n * @param previousOwner previous `_owner` address.\\n * @param newOwner new `_owner` address.\\n */\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /* ============ Deploy ============ */\\n\\n /**\\n * @notice Initializes the contract setting `_initialOwner` as the initial owner.\\n * @param _initialOwner Initial owner of the contract.\\n */\\n constructor(address _initialOwner) {\\n _setOwner(_initialOwner);\\n }\\n\\n /* ============ External Functions ============ */\\n\\n /**\\n * @notice Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @notice Gets current `_pendingOwner`.\\n * @return Current `_pendingOwner` address.\\n */\\n function pendingOwner() external view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @notice Renounce ownership of the contract.\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external virtual onlyOwner {\\n _setOwner(address(0));\\n }\\n\\n /**\\n * @notice Allows current owner to set the `_pendingOwner` address.\\n * @param _newOwner Address to transfer ownership to.\\n */\\n function transferOwnership(address _newOwner) external onlyOwner {\\n require(_newOwner != address(0), \\\"Ownable/pendingOwner-not-zero-address\\\");\\n\\n _pendingOwner = _newOwner;\\n\\n emit OwnershipOffered(_newOwner);\\n }\\n\\n /**\\n * @notice Allows the `_pendingOwner` address to finalize the transfer.\\n * @dev This function is only callable by the `_pendingOwner`.\\n */\\n function claimOwnership() external onlyPendingOwner {\\n _setOwner(_pendingOwner);\\n _pendingOwner = address(0);\\n }\\n\\n /* ============ Internal Functions ============ */\\n\\n /**\\n * @notice Internal function to set the `_owner` of the contract.\\n * @param _newOwner New `_owner` address.\\n */\\n function _setOwner(address _newOwner) private {\\n address _oldOwner = _owner;\\n _owner = _newOwner;\\n emit OwnershipTransferred(_oldOwner, _newOwner);\\n }\\n\\n /* ============ Modifier Functions ============ */\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == msg.sender, \\\"Ownable/caller-not-owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the `pendingOwner`.\\n */\\n modifier onlyPendingOwner() {\\n require(msg.sender == _pendingOwner, \\\"Ownable/caller-not-pendingOwner\\\");\\n _;\\n }\\n}\\n\",\"keccak256\":\"0xfd0fd374812c8af45f2633cc7cc4811ccb7bad0a3902a43aded35939eb4a00d1\",\"license\":\"GPL-3.0\"},\"@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol\\\";\\nimport \\\"@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol\\\";\\nimport \\\"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\\\";\\n\\nimport \\\"./RNGChainlinkV2Interface.sol\\\";\\n\\ncontract RNGChainlinkV2 is RNGChainlinkV2Interface, VRFConsumerBaseV2, Manageable {\\n /* ============ Global Variables ============ */\\n\\n /// @dev Reference to the VRFCoordinatorV2 deployed contract\\n VRFCoordinatorV2Interface internal vrfCoordinator;\\n\\n /// @dev A counter for the number of requests made used for request ids\\n uint32 internal requestCounter;\\n\\n /// @dev Chainlink VRF subscription id\\n uint64 internal subscriptionId;\\n\\n /// @dev Hash of the public key used to verify the VRF proof\\n bytes32 internal keyHash;\\n\\n /// @dev A list of random numbers from past requests mapped by request id\\n mapping(uint32 => uint256) internal randomNumbers;\\n\\n /// @dev A list of blocks to be locked at based on past requests mapped by request id\\n mapping(uint32 => uint32) internal requestLockBlock;\\n\\n /// @dev A mapping from Chainlink request ids to internal request ids\\n mapping(uint256 => uint32) internal chainlinkRequestIds;\\n\\n /* ============ Events ============ */\\n\\n /**\\n * @notice Emitted when the Chainlink VRF keyHash is set\\n * @param keyHash Chainlink VRF keyHash\\n */\\n event KeyHashSet(bytes32 keyHash);\\n\\n /**\\n * @notice Emitted when the Chainlink VRF subscription id is set\\n * @param subscriptionId Chainlink VRF subscription id\\n */\\n event SubscriptionIdSet(uint64 subscriptionId);\\n\\n /**\\n * @notice Emitted when the Chainlink VRF Coordinator address is set\\n * @param vrfCoordinator Address of the VRF Coordinator\\n */\\n event VrfCoordinatorSet(VRFCoordinatorV2Interface indexed vrfCoordinator);\\n\\n /* ============ Constructor ============ */\\n\\n /**\\n * @notice Constructor of the contract\\n * @param _owner Owner of the contract\\n * @param _vrfCoordinator Address of the VRF Coordinator\\n * @param _subscriptionId Chainlink VRF subscription id\\n * @param _keyHash Hash of the public key used to verify the VRF proof\\n */\\n constructor(\\n address _owner,\\n VRFCoordinatorV2Interface _vrfCoordinator,\\n uint64 _subscriptionId,\\n bytes32 _keyHash\\n ) Ownable(_owner) VRFConsumerBaseV2(address(_vrfCoordinator)) {\\n _setVRFCoordinator(_vrfCoordinator);\\n _setSubscriptionId(_subscriptionId);\\n _setKeyhash(_keyHash);\\n }\\n\\n /* ============ External Functions ============ */\\n\\n /// @inheritdoc RNGInterface\\n function requestRandomNumber()\\n external\\n override\\n onlyManager\\n returns (uint32 requestId, uint32 lockBlock)\\n {\\n uint256 _vrfRequestId = vrfCoordinator.requestRandomWords(\\n keyHash,\\n subscriptionId,\\n 3,\\n 1000000,\\n 1\\n );\\n\\n requestCounter++;\\n uint32 _requestCounter = requestCounter;\\n\\n requestId = _requestCounter;\\n chainlinkRequestIds[_vrfRequestId] = _requestCounter;\\n\\n lockBlock = uint32(block.number);\\n requestLockBlock[_requestCounter] = lockBlock;\\n\\n emit RandomNumberRequested(_requestCounter, msg.sender);\\n }\\n\\n /// @inheritdoc RNGInterface\\n function isRequestComplete(uint32 _internalRequestId)\\n external\\n view\\n override\\n returns (bool isCompleted)\\n {\\n return randomNumbers[_internalRequestId] != 0;\\n }\\n\\n /// @inheritdoc RNGInterface\\n function randomNumber(uint32 _internalRequestId)\\n external\\n view\\n override\\n returns (uint256 randomNum)\\n {\\n return randomNumbers[_internalRequestId];\\n }\\n\\n /// @inheritdoc RNGInterface\\n function getLastRequestId() external view override returns (uint32 requestId) {\\n return requestCounter;\\n }\\n\\n /// @inheritdoc RNGInterface\\n function getRequestFee() external pure override returns (address feeToken, uint256 requestFee) {\\n return (address(0), 0);\\n }\\n\\n /// @inheritdoc RNGChainlinkV2Interface\\n function getKeyHash() external view override returns (bytes32) {\\n return keyHash;\\n }\\n\\n /// @inheritdoc RNGChainlinkV2Interface\\n function getSubscriptionId() external view override returns (uint64) {\\n return subscriptionId;\\n }\\n\\n /// @inheritdoc RNGChainlinkV2Interface\\n function getVrfCoordinator() external view override returns (VRFCoordinatorV2Interface) {\\n return vrfCoordinator;\\n }\\n\\n /// @inheritdoc RNGChainlinkV2Interface\\n function setSubscriptionId(uint64 _subscriptionId) external override onlyOwner {\\n _setSubscriptionId(_subscriptionId);\\n }\\n\\n /// @inheritdoc RNGChainlinkV2Interface\\n function setKeyhash(bytes32 _keyHash) external override onlyOwner {\\n _setKeyhash(_keyHash);\\n }\\n\\n /* ============ Internal Functions ============ */\\n\\n /**\\n * @notice Callback function called by VRF Coordinator\\n * @dev The VRF Coordinator will only call it once it has verified the proof associated with the randomness.\\n * @param _vrfRequestId Chainlink VRF request id\\n * @param _randomWords Chainlink VRF array of random words\\n */\\n function fulfillRandomWords(uint256 _vrfRequestId, uint256[] memory _randomWords)\\n internal\\n override\\n {\\n uint32 _internalRequestId = chainlinkRequestIds[_vrfRequestId];\\n require(_internalRequestId > 0, \\\"RNGChainLink/requestId-incorrect\\\");\\n\\n uint256 _randomNumber = _randomWords[0];\\n randomNumbers[_internalRequestId] = _randomNumber;\\n\\n emit RandomNumberCompleted(_internalRequestId, _randomNumber);\\n }\\n\\n /**\\n * @notice Set Chainlink VRF coordinator contract address.\\n * @param _vrfCoordinator Chainlink VRF coordinator contract address\\n */\\n function _setVRFCoordinator(VRFCoordinatorV2Interface _vrfCoordinator) internal {\\n require(address(_vrfCoordinator) != address(0), \\\"RNGChainLink/vrf-not-zero-addr\\\");\\n vrfCoordinator = _vrfCoordinator;\\n emit VrfCoordinatorSet(_vrfCoordinator);\\n }\\n\\n /**\\n * @notice Set Chainlink VRF subscription id associated with this contract.\\n * @param _subscriptionId Chainlink VRF subscription id\\n */\\n function _setSubscriptionId(uint64 _subscriptionId) internal {\\n require(_subscriptionId > 0, \\\"RNGChainLink/subId-gt-zero\\\");\\n subscriptionId = _subscriptionId;\\n emit SubscriptionIdSet(_subscriptionId);\\n }\\n\\n /**\\n * @notice Set Chainlink VRF keyHash.\\n * @param _keyHash Chainlink VRF keyHash\\n */\\n function _setKeyhash(bytes32 _keyHash) internal {\\n require(_keyHash != bytes32(0), \\\"RNGChainLink/keyHash-not-empty\\\");\\n keyHash = _keyHash;\\n emit KeyHashSet(_keyHash);\\n }\\n}\\n\",\"keccak256\":\"0xa771db41fc9ab0c9ad0620adb126185fd66797fd7257bae7df3f777ad4b2a292\",\"license\":\"GPL-3.0\"},\"@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2Interface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\nimport \\\"@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol\\\";\\n\\nimport \\\"./RNGInterface.sol\\\";\\n\\n/**\\n * @title RNG Chainlink V2 Interface\\n * @notice Provides an interface for requesting random numbers from Chainlink VRF V2.\\n */\\ninterface RNGChainlinkV2Interface is RNGInterface {\\n /**\\n * @notice Get Chainlink VRF keyHash associated with this contract.\\n * @return bytes32 Chainlink VRF keyHash\\n */\\n function getKeyHash() external view returns (bytes32);\\n\\n /**\\n * @notice Get Chainlink VRF subscription id associated with this contract.\\n * @return uint64 Chainlink VRF subscription id\\n */\\n function getSubscriptionId() external view returns (uint64);\\n\\n /**\\n * @notice Get Chainlink VRF coordinator contract address associated with this contract.\\n * @return address Chainlink VRF coordinator address\\n */\\n function getVrfCoordinator() external view returns (VRFCoordinatorV2Interface);\\n\\n /**\\n * @notice Set Chainlink VRF keyHash.\\n * @dev This function is only callable by the owner.\\n * @param keyHash Chainlink VRF keyHash\\n */\\n function setKeyhash(bytes32 keyHash) external;\\n\\n /**\\n * @notice Set Chainlink VRF subscription id associated with this contract.\\n * @dev This function is only callable by the owner.\\n * @param subscriptionId Chainlink VRF subscription id\\n */\\n function setSubscriptionId(uint64 subscriptionId) external;\\n}\\n\",\"keccak256\":\"0xc1fb0dfc19a27987253f98a9c7e9ebf57f1248004115f6f43308f85b5adaff71\",\"license\":\"GPL-3.0\"},\"@pooltogether/pooltogether-rng-contracts/contracts/RNGInterface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.8.6;\\n\\n/**\\n * @title Random Number Generator Interface\\n * @notice Provides an interface for requesting random numbers from 3rd-party RNG services (Chainlink VRF, Starkware VDF, etc..)\\n */\\ninterface RNGInterface {\\n /**\\n * @notice Emitted when a new request for a random number has been submitted\\n * @param requestId The indexed ID of the request used to get the results of the RNG service\\n * @param sender The indexed address of the sender of the request\\n */\\n event RandomNumberRequested(uint32 indexed requestId, address indexed sender);\\n\\n /**\\n * @notice Emitted when an existing request for a random number has been completed\\n * @param requestId The indexed ID of the request used to get the results of the RNG service\\n * @param randomNumber The random number produced by the 3rd-party service\\n */\\n event RandomNumberCompleted(uint32 indexed requestId, uint256 randomNumber);\\n\\n /**\\n * @notice Gets the last request id used by the RNG service\\n * @return requestId The last request id used in the last request\\n */\\n function getLastRequestId() external view returns (uint32 requestId);\\n\\n /**\\n * @notice Gets the Fee for making a Request against an RNG service\\n * @return feeToken The address of the token that is used to pay fees\\n * @return requestFee The fee required to be paid to make a request\\n */\\n function getRequestFee() external view returns (address feeToken, uint256 requestFee);\\n\\n /**\\n * @notice Sends a request for a random number to the 3rd-party service\\n * @dev Some services will complete the request immediately, others may have a time-delay\\n * @dev Some services require payment in the form of a token, such as $LINK for Chainlink VRF\\n * @return requestId The ID of the request used to get the results of the RNG service\\n * @return lockBlock The block number at which the RNG service will start generating time-delayed randomness.\\n * The calling contract should \\\"lock\\\" all activity until the result is available via the `requestId`\\n */\\n function requestRandomNumber() external returns (uint32 requestId, uint32 lockBlock);\\n\\n /**\\n * @notice Checks if the request for randomness from the 3rd-party service has completed\\n * @dev For time-delayed requests, this function is used to check/confirm completion\\n * @param requestId The ID of the request used to get the results of the RNG service\\n * @return isCompleted True if the request has completed and a random number is available, false otherwise\\n */\\n function isRequestComplete(uint32 requestId) external view returns (bool isCompleted);\\n\\n /**\\n * @notice Gets the random number produced by the 3rd-party service\\n * @param requestId The ID of the request used to get the results of the RNG service\\n * @return randomNum The random number\\n */\\n function randomNumber(uint32 requestId) external returns (uint256 randomNum);\\n}\\n\",\"keccak256\":\"0x24803ae776bba768a3a3f65d3b7e5fc100c7b5881a8e5e39d6c5df2735a3b5cb\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x60a06040523480156200001157600080fd5b506040516200127e3803806200127e8339810160408190526200003491620002b1565b6001600160601b0319606084901b166080528362000052816200007e565b506200005e83620000ce565b620000698262000174565b62000074816200022c565b505050506200032f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381166200012a5760405162461bcd60e51b815260206004820152601e60248201527f524e47436861696e4c696e6b2f7672662d6e6f742d7a65726f2d61646472000060448201526064015b60405180910390fd5b600380546001600160a01b0319166001600160a01b0383169081179091556040517f4cc41e06d3d0588be9be0e1469ba1934c4bd1cb8f4f70adf2aa31f4b92134b2790600090a250565b6000816001600160401b031611620001cf5760405162461bcd60e51b815260206004820152601a60248201527f524e47436861696e4c696e6b2f73756249642d67742d7a65726f000000000000604482015260640162000121565b600380546001600160c01b0316600160c01b6001600160401b038416908102919091179091556040519081527f68de96e24c66c14c012b5bd342251abc26a6003eaa438002bfe530f28ca63fed906020015b60405180910390a150565b806200027b5760405162461bcd60e51b815260206004820152601e60248201527f524e47436861696e4c696e6b2f6b6579486173682d6e6f742d656d7074790000604482015260640162000121565b60048190556040518181527fd013f86c8346660ebf421351882cd1b3c2f91883092df1800264c656b0db0cc69060200162000221565b60008060008060808587031215620002c857600080fd5b8451620002d58162000316565b6020860151909450620002e88162000316565b60408601519093506001600160401b03811681146200030657600080fd5b6060959095015193969295505050565b6001600160a01b03811681146200032c57600080fd5b50565b60805160601c610f296200035560003960008181610320015261037b0152610f296000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c8063715018a6116100b2578063d0ebdbe711610081578063e30c397811610066578063e30c3978146102de578063ea7b4f77146102ef578063f2fde38b1461030257600080fd5b8063d0ebdbe71461029e578063de3d9fb7146102b157600080fd5b8063715018a61461023a5780638678a7b2146102425780638da5cb5b146102675780639d2a5f981461027857600080fd5b8063331bf12511610109578063481c6a75116100ee578063481c6a751461020e5780634e71e0c81461021f5780636309b7731461022757600080fd5b8063331bf125146101c45780633a19b9bc146101d657600080fd5b80630cb4a29d1461013b5780630d37b5371461016557806319c2b4c3146101795780631fe543e3146101af575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b60408051600080825260208201520161015c565b60035474010000000000000000000000000000000000000000900463ffffffff1660405163ffffffff909116815260200161015c565b6101c26101bd366004610d56565b610315565b005b6004545b60405190815260200161015c565b6101fe6101e4366004610e45565b63ffffffff16600090815260056020526040902054151590565b604051901515815260200161015c565b6002546001600160a01b0316610148565b6101c26103bb565b6101c2610235366004610d24565b610449565b6101c26104be565b61024a610533565b6040805163ffffffff93841681529290911660208301520161015c565b6000546001600160a01b0316610148565b6101c8610286366004610e45565b63ffffffff1660009081526005602052604090205490565b6101fe6102ac366004610cf4565b610763565b600354600160c01b900467ffffffffffffffff1660405167ffffffffffffffff909116815260200161015c565b6001546001600160a01b0316610148565b6101c26102fd366004610e6b565b6107dd565b6101c2610310366004610cf4565b61084f565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103ad576040517f1cf993f40000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b6103b7828261098b565b5050565b6001546001600160a01b031633146104155760405162461bcd60e51b815260206004820152601f60248201527f4f776e61626c652f63616c6c65722d6e6f742d70656e64696e674f776e65720060448201526064016103a4565b60015461042a906001600160a01b0316610a60565b6001805473ffffffffffffffffffffffffffffffffffffffff19169055565b3361045c6000546001600160a01b031690565b6001600160a01b0316146104b25760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e6572000000000000000060448201526064016103a4565b6104bb81610abd565b50565b336104d16000546001600160a01b031690565b6001600160a01b0316146105275760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e6572000000000000000060448201526064016103a4565b6105316000610a60565b565b600080336105496002546001600160a01b031690565b6001600160a01b03161461059f5760405162461bcd60e51b815260206004820152601d60248201527f4d616e61676561626c652f63616c6c65722d6e6f742d6d616e6167657200000060448201526064016103a4565b60038054600480546040517f5d3b1d3000000000000000000000000000000000000000000000000000000000815291820152600160c01b820467ffffffffffffffff1660248201526044810192909252620f42406064830152600160848301526000916001600160a01b0390911690635d3b1d309060a401602060405180830381600087803b15801561063157600080fd5b505af1158015610645573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106699190610d3d565b600380549192507401000000000000000000000000000000000000000090910463ffffffff1690601461069b83610e95565b82546101009290920a63ffffffff818102199093169183160217909155600354600084815260076020908152604080832080547401000000000000000000000000000000000000000090950486167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000095861681179091558084526006909252808320805490941643958616179093559151919650919450859250339183917fcf635b20f2defc1e71326dc4f0b616fa676e29a5bae87da19fcaddc550b33f039190a350509091565b6000336107786000546001600160a01b031690565b6001600160a01b0316146107ce5760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e6572000000000000000060448201526064016103a4565b6107d782610b46565b92915050565b336107f06000546001600160a01b031690565b6001600160a01b0316146108465760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e6572000000000000000060448201526064016103a4565b6104bb81610c32565b336108626000546001600160a01b031690565b6001600160a01b0316146108b85760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e6572000000000000000060448201526064016103a4565b6001600160a01b0381166109345760405162461bcd60e51b815260206004820152602560248201527f4f776e61626c652f70656e64696e674f776e65722d6e6f742d7a65726f2d616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103a4565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f239a2ddded15777fa246aed5f7e1a9bc69a39d4eb4a397034d1d85766cca7d4c90600090a250565b60008281526007602052604090205463ffffffff16806109ed5760405162461bcd60e51b815260206004820181905260248201527f524e47436861696e4c696e6b2f7265717565737449642d696e636f727265637460448201526064016103a4565b600082600081518110610a0257610a02610ec7565b60209081029190910181015163ffffffff841660008181526005845260409081902083905551828152919350917f629394f18de7accce1179c28c39be59503a57cbcf45980a2772743b041b36271910160405180910390a250505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80610b0a5760405162461bcd60e51b815260206004820152601e60248201527f524e47436861696e4c696e6b2f6b6579486173682d6e6f742d656d707479000060448201526064016103a4565b60048190556040518181527fd013f86c8346660ebf421351882cd1b3c2f91883092df1800264c656b0db0cc6906020015b60405180910390a150565b6002546000906001600160a01b03908116908316811415610bcf5760405162461bcd60e51b815260206004820152602360248201527f4d616e61676561626c652f6578697374696e672d6d616e616765722d6164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016103a4565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385811691821790925560405190918316907f9cb45c728de594dab506a1f1a8554e24c8eeaf983618d5ec5dd7bc6f3c49feee90600090a350600192915050565b60008167ffffffffffffffff1611610c8c5760405162461bcd60e51b815260206004820152601a60248201527f524e47436861696e4c696e6b2f73756249642d67742d7a65726f00000000000060448201526064016103a4565b6003805477ffffffffffffffffffffffffffffffffffffffffffffffff16600160c01b67ffffffffffffffff8416908102919091179091556040519081527f68de96e24c66c14c012b5bd342251abc26a6003eaa438002bfe530f28ca63fed90602001610b3b565b600060208284031215610d0657600080fd5b81356001600160a01b0381168114610d1d57600080fd5b9392505050565b600060208284031215610d3657600080fd5b5035919050565b600060208284031215610d4f57600080fd5b5051919050565b60008060408385031215610d6957600080fd5b8235915060208084013567ffffffffffffffff80821115610d8957600080fd5b818601915086601f830112610d9d57600080fd5b813581811115610daf57610daf610edd565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715610df257610df2610edd565b604052828152858101935084860182860187018b1015610e1157600080fd5b600095505b83861015610e34578035855260019590950194938601938601610e16565b508096505050505050509250929050565b600060208284031215610e5757600080fd5b813563ffffffff81168114610d1d57600080fd5b600060208284031215610e7d57600080fd5b813567ffffffffffffffff81168114610d1d57600080fd5b600063ffffffff80831681811415610ebd57634e487b7160e01b600052601160045260246000fd5b6001019392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212205e31f6977d0789e2ea185a5db4cf5698eb3198898cf06f04f5d767120890540b64736f6c63430008060033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101365760003560e01c8063715018a6116100b2578063d0ebdbe711610081578063e30c397811610066578063e30c3978146102de578063ea7b4f77146102ef578063f2fde38b1461030257600080fd5b8063d0ebdbe71461029e578063de3d9fb7146102b157600080fd5b8063715018a61461023a5780638678a7b2146102425780638da5cb5b146102675780639d2a5f981461027857600080fd5b8063331bf12511610109578063481c6a75116100ee578063481c6a751461020e5780634e71e0c81461021f5780636309b7731461022757600080fd5b8063331bf125146101c45780633a19b9bc146101d657600080fd5b80630cb4a29d1461013b5780630d37b5371461016557806319c2b4c3146101795780631fe543e3146101af575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b60408051600080825260208201520161015c565b60035474010000000000000000000000000000000000000000900463ffffffff1660405163ffffffff909116815260200161015c565b6101c26101bd366004610d56565b610315565b005b6004545b60405190815260200161015c565b6101fe6101e4366004610e45565b63ffffffff16600090815260056020526040902054151590565b604051901515815260200161015c565b6002546001600160a01b0316610148565b6101c26103bb565b6101c2610235366004610d24565b610449565b6101c26104be565b61024a610533565b6040805163ffffffff93841681529290911660208301520161015c565b6000546001600160a01b0316610148565b6101c8610286366004610e45565b63ffffffff1660009081526005602052604090205490565b6101fe6102ac366004610cf4565b610763565b600354600160c01b900467ffffffffffffffff1660405167ffffffffffffffff909116815260200161015c565b6001546001600160a01b0316610148565b6101c26102fd366004610e6b565b6107dd565b6101c2610310366004610cf4565b61084f565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103ad576040517f1cf993f40000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b6103b7828261098b565b5050565b6001546001600160a01b031633146104155760405162461bcd60e51b815260206004820152601f60248201527f4f776e61626c652f63616c6c65722d6e6f742d70656e64696e674f776e65720060448201526064016103a4565b60015461042a906001600160a01b0316610a60565b6001805473ffffffffffffffffffffffffffffffffffffffff19169055565b3361045c6000546001600160a01b031690565b6001600160a01b0316146104b25760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e6572000000000000000060448201526064016103a4565b6104bb81610abd565b50565b336104d16000546001600160a01b031690565b6001600160a01b0316146105275760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e6572000000000000000060448201526064016103a4565b6105316000610a60565b565b600080336105496002546001600160a01b031690565b6001600160a01b03161461059f5760405162461bcd60e51b815260206004820152601d60248201527f4d616e61676561626c652f63616c6c65722d6e6f742d6d616e6167657200000060448201526064016103a4565b60038054600480546040517f5d3b1d3000000000000000000000000000000000000000000000000000000000815291820152600160c01b820467ffffffffffffffff1660248201526044810192909252620f42406064830152600160848301526000916001600160a01b0390911690635d3b1d309060a401602060405180830381600087803b15801561063157600080fd5b505af1158015610645573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106699190610d3d565b600380549192507401000000000000000000000000000000000000000090910463ffffffff1690601461069b83610e95565b82546101009290920a63ffffffff818102199093169183160217909155600354600084815260076020908152604080832080547401000000000000000000000000000000000000000090950486167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000095861681179091558084526006909252808320805490941643958616179093559151919650919450859250339183917fcf635b20f2defc1e71326dc4f0b616fa676e29a5bae87da19fcaddc550b33f039190a350509091565b6000336107786000546001600160a01b031690565b6001600160a01b0316146107ce5760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e6572000000000000000060448201526064016103a4565b6107d782610b46565b92915050565b336107f06000546001600160a01b031690565b6001600160a01b0316146108465760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e6572000000000000000060448201526064016103a4565b6104bb81610c32565b336108626000546001600160a01b031690565b6001600160a01b0316146108b85760405162461bcd60e51b815260206004820152601860248201527f4f776e61626c652f63616c6c65722d6e6f742d6f776e6572000000000000000060448201526064016103a4565b6001600160a01b0381166109345760405162461bcd60e51b815260206004820152602560248201527f4f776e61626c652f70656e64696e674f776e65722d6e6f742d7a65726f2d616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103a4565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f239a2ddded15777fa246aed5f7e1a9bc69a39d4eb4a397034d1d85766cca7d4c90600090a250565b60008281526007602052604090205463ffffffff16806109ed5760405162461bcd60e51b815260206004820181905260248201527f524e47436861696e4c696e6b2f7265717565737449642d696e636f727265637460448201526064016103a4565b600082600081518110610a0257610a02610ec7565b60209081029190910181015163ffffffff841660008181526005845260409081902083905551828152919350917f629394f18de7accce1179c28c39be59503a57cbcf45980a2772743b041b36271910160405180910390a250505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80610b0a5760405162461bcd60e51b815260206004820152601e60248201527f524e47436861696e4c696e6b2f6b6579486173682d6e6f742d656d707479000060448201526064016103a4565b60048190556040518181527fd013f86c8346660ebf421351882cd1b3c2f91883092df1800264c656b0db0cc6906020015b60405180910390a150565b6002546000906001600160a01b03908116908316811415610bcf5760405162461bcd60e51b815260206004820152602360248201527f4d616e61676561626c652f6578697374696e672d6d616e616765722d6164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016103a4565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385811691821790925560405190918316907f9cb45c728de594dab506a1f1a8554e24c8eeaf983618d5ec5dd7bc6f3c49feee90600090a350600192915050565b60008167ffffffffffffffff1611610c8c5760405162461bcd60e51b815260206004820152601a60248201527f524e47436861696e4c696e6b2f73756249642d67742d7a65726f00000000000060448201526064016103a4565b6003805477ffffffffffffffffffffffffffffffffffffffffffffffff16600160c01b67ffffffffffffffff8416908102919091179091556040519081527f68de96e24c66c14c012b5bd342251abc26a6003eaa438002bfe530f28ca63fed90602001610b3b565b600060208284031215610d0657600080fd5b81356001600160a01b0381168114610d1d57600080fd5b9392505050565b600060208284031215610d3657600080fd5b5035919050565b600060208284031215610d4f57600080fd5b5051919050565b60008060408385031215610d6957600080fd5b8235915060208084013567ffffffffffffffff80821115610d8957600080fd5b818601915086601f830112610d9d57600080fd5b813581811115610daf57610daf610edd565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715610df257610df2610edd565b604052828152858101935084860182860187018b1015610e1157600080fd5b600095505b83861015610e34578035855260019590950194938601938601610e16565b508096505050505050509250929050565b600060208284031215610e5757600080fd5b813563ffffffff81168114610d1d57600080fd5b600060208284031215610e7d57600080fd5b813567ffffffffffffffff81168114610d1d57600080fd5b600063ffffffff80831681811415610ebd57634e487b7160e01b600052601160045260246000fd5b6001019392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212205e31f6977d0789e2ea185a5db4cf5698eb3198898cf06f04f5d767120890540b64736f6c63430008060033", + "devdoc": { + "events": { + "KeyHashSet(bytes32)": { + "params": { + "keyHash": "Chainlink VRF keyHash" + } + }, + "SubscriptionIdSet(uint64)": { + "params": { + "subscriptionId": "Chainlink VRF subscription id" + } + }, + "VrfCoordinatorSet(address)": { + "params": { + "vrfCoordinator": "Address of the VRF Coordinator" + } + } + }, + "kind": "dev", + "methods": { + "claimOwnership()": { + "details": "This function is only callable by the `_pendingOwner`." + }, + "constructor": { + "params": { + "_keyHash": "Hash of the public key used to verify the VRF proof", + "_owner": "Owner of the contract", + "_subscriptionId": "Chainlink VRF subscription id", + "_vrfCoordinator": "Address of the VRF Coordinator" + } + }, + "getKeyHash()": { + "returns": { + "_0": "bytes32 Chainlink VRF keyHash" + } + }, + "getLastRequestId()": { + "returns": { + "requestId": "The last request id used in the last request" + } + }, + "getRequestFee()": { + "returns": { + "feeToken": "The address of the token that is used to pay fees", + "requestFee": "The fee required to be paid to make a request" + } + }, + "getSubscriptionId()": { + "returns": { + "_0": "uint64 Chainlink VRF subscription id" + } + }, + "getVrfCoordinator()": { + "returns": { + "_0": "address Chainlink VRF coordinator address" + } + }, + "isRequestComplete(uint32)": { + "details": "For time-delayed requests, this function is used to check/confirm completion", + "params": { + "requestId": "The ID of the request used to get the results of the RNG service" + }, + "returns": { + "isCompleted": "True if the request has completed and a random number is available, false otherwise" + } + }, + "manager()": { + "returns": { + "_0": "Current `_manager` address." + } + }, + "pendingOwner()": { + "returns": { + "_0": "Current `_pendingOwner` address." + } + }, + "randomNumber(uint32)": { + "params": { + "requestId": "The ID of the request used to get the results of the RNG service" + }, + "returns": { + "randomNum": "The random number" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "requestRandomNumber()": { + "details": "Some services will complete the request immediately, others may have a time-delaySome services require payment in the form of a token, such as $LINK for Chainlink VRF", + "returns": { + "lockBlock": "The block number at which the RNG service will start generating time-delayed randomness. The calling contract should \"lock\" all activity until the result is available via the `requestId`", + "requestId": "The ID of the request used to get the results of the RNG service" + } + }, + "setKeyhash(bytes32)": { + "details": "This function is only callable by the owner.", + "params": { + "keyHash": "Chainlink VRF keyHash" + } + }, + "setManager(address)": { + "details": "Throws if called by any account other than the owner.", + "params": { + "_newManager": "New _manager address." + }, + "returns": { + "_0": "Boolean to indicate if the operation was successful or not." + } + }, + "setSubscriptionId(uint64)": { + "details": "This function is only callable by the owner.", + "params": { + "subscriptionId": "Chainlink VRF subscription id" + } + }, + "transferOwnership(address)": { + "params": { + "_newOwner": "Address to transfer ownership to." + } + } + }, + "stateVariables": { + "chainlinkRequestIds": { + "details": "A mapping from Chainlink request ids to internal request ids" + }, + "keyHash": { + "details": "Hash of the public key used to verify the VRF proof" + }, + "randomNumbers": { + "details": "A list of random numbers from past requests mapped by request id" + }, + "requestCounter": { + "details": "A counter for the number of requests made used for request ids" + }, + "requestLockBlock": { + "details": "A list of blocks to be locked at based on past requests mapped by request id" + }, + "subscriptionId": { + "details": "Chainlink VRF subscription id" + }, + "vrfCoordinator": { + "details": "Reference to the VRFCoordinatorV2 deployed contract" + } + }, + "version": 1 + }, + "userdoc": { + "events": { + "KeyHashSet(bytes32)": { + "notice": "Emitted when the Chainlink VRF keyHash is set" + }, + "RandomNumberCompleted(uint32,uint256)": { + "notice": "Emitted when an existing request for a random number has been completed" + }, + "RandomNumberRequested(uint32,address)": { + "notice": "Emitted when a new request for a random number has been submitted" + }, + "SubscriptionIdSet(uint64)": { + "notice": "Emitted when the Chainlink VRF subscription id is set" + }, + "VrfCoordinatorSet(address)": { + "notice": "Emitted when the Chainlink VRF Coordinator address is set" + } + }, + "kind": "user", + "methods": { + "claimOwnership()": { + "notice": "Allows the `_pendingOwner` address to finalize the transfer." + }, + "constructor": { + "notice": "Constructor of the contract" + }, + "getKeyHash()": { + "notice": "Get Chainlink VRF keyHash associated with this contract." + }, + "getLastRequestId()": { + "notice": "Gets the last request id used by the RNG service" + }, + "getRequestFee()": { + "notice": "Gets the Fee for making a Request against an RNG service" + }, + "getSubscriptionId()": { + "notice": "Get Chainlink VRF subscription id associated with this contract." + }, + "getVrfCoordinator()": { + "notice": "Get Chainlink VRF coordinator contract address associated with this contract." + }, + "isRequestComplete(uint32)": { + "notice": "Checks if the request for randomness from the 3rd-party service has completed" + }, + "manager()": { + "notice": "Gets current `_manager`." + }, + "owner()": { + "notice": "Returns the address of the current owner." + }, + "pendingOwner()": { + "notice": "Gets current `_pendingOwner`." + }, + "randomNumber(uint32)": { + "notice": "Gets the random number produced by the 3rd-party service" + }, + "renounceOwnership()": { + "notice": "Renounce ownership of the contract." + }, + "requestRandomNumber()": { + "notice": "Sends a request for a random number to the 3rd-party service" + }, + "setKeyhash(bytes32)": { + "notice": "Set Chainlink VRF keyHash." + }, + "setManager(address)": { + "notice": "Set or change of manager." + }, + "setSubscriptionId(uint64)": { + "notice": "Set Chainlink VRF subscription id associated with this contract." + }, + "transferOwnership(address)": { + "notice": "Allows current owner to set the `_pendingOwner` address." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 5205, + "contract": "@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol:RNGChainlinkV2", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 5207, + "contract": "@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol:RNGChainlinkV2", + "label": "_pendingOwner", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 5103, + "contract": "@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol:RNGChainlinkV2", + "label": "_manager", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 5371, + "contract": "@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol:RNGChainlinkV2", + "label": "vrfCoordinator", + "offset": 0, + "slot": "3", + "type": "t_contract(VRFCoordinatorV2Interface)146" + }, + { + "astId": 5374, + "contract": "@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol:RNGChainlinkV2", + "label": "requestCounter", + "offset": 20, + "slot": "3", + "type": "t_uint32" + }, + { + "astId": 5377, + "contract": "@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol:RNGChainlinkV2", + "label": "subscriptionId", + "offset": 24, + "slot": "3", + "type": "t_uint64" + }, + { + "astId": 5380, + "contract": "@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol:RNGChainlinkV2", + "label": "keyHash", + "offset": 0, + "slot": "4", + "type": "t_bytes32" + }, + { + "astId": 5385, + "contract": "@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol:RNGChainlinkV2", + "label": "randomNumbers", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_uint32,t_uint256)" + }, + { + "astId": 5390, + "contract": "@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol:RNGChainlinkV2", + "label": "requestLockBlock", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_uint32,t_uint32)" + }, + { + "astId": 5395, + "contract": "@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol:RNGChainlinkV2", + "label": "chainlinkRequestIds", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_uint256,t_uint32)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(VRFCoordinatorV2Interface)146": { + "encoding": "inplace", + "label": "contract VRFCoordinatorV2Interface", + "numberOfBytes": "20" + }, + "t_mapping(t_uint256,t_uint32)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint32)", + "numberOfBytes": "32", + "value": "t_uint32" + }, + "t_mapping(t_uint32,t_uint256)": { + "encoding": "mapping", + "key": "t_uint32", + "label": "mapping(uint32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint32,t_uint32)": { + "encoding": "mapping", + "key": "t_uint32", + "label": "mapping(uint32 => uint32)", + "numberOfBytes": "32", + "value": "t_uint32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/deployments/polygon/solcInputs/81bc9ae0cb2caeb2744ac5c81556a380.json b/deployments/polygon/solcInputs/81bc9ae0cb2caeb2744ac5c81556a380.json new file mode 100644 index 0000000..adef221 --- /dev/null +++ b/deployments/polygon/solcInputs/81bc9ae0cb2caeb2744ac5c81556a380.json @@ -0,0 +1,336 @@ +{ + "language": "Solidity", + "sources": { + "@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol\";\nimport \"@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol\";\nimport \"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\";\n\nimport \"./RNGChainlinkV2Interface.sol\";\n\ncontract RNGChainlinkV2 is RNGChainlinkV2Interface, VRFConsumerBaseV2, Manageable {\n /* ============ Global Variables ============ */\n\n /// @dev Reference to the VRFCoordinatorV2 deployed contract\n VRFCoordinatorV2Interface internal vrfCoordinator;\n\n /// @dev A counter for the number of requests made used for request ids\n uint32 internal requestCounter;\n\n /// @dev Chainlink VRF subscription id\n uint64 internal subscriptionId;\n\n /// @dev Hash of the public key used to verify the VRF proof\n bytes32 internal keyHash;\n\n /// @dev A list of random numbers from past requests mapped by request id\n mapping(uint32 => uint256) internal randomNumbers;\n\n /// @dev A list of blocks to be locked at based on past requests mapped by request id\n mapping(uint32 => uint32) internal requestLockBlock;\n\n /// @dev A mapping from Chainlink request ids to internal request ids\n mapping(uint256 => uint32) internal chainlinkRequestIds;\n\n /* ============ Events ============ */\n\n /**\n * @notice Emitted when the Chainlink VRF keyHash is set\n * @param keyHash Chainlink VRF keyHash\n */\n event KeyHashSet(bytes32 keyHash);\n\n /**\n * @notice Emitted when the Chainlink VRF subscription id is set\n * @param subscriptionId Chainlink VRF subscription id\n */\n event SubscriptionIdSet(uint64 subscriptionId);\n\n /**\n * @notice Emitted when the Chainlink VRF Coordinator address is set\n * @param vrfCoordinator Address of the VRF Coordinator\n */\n event VrfCoordinatorSet(VRFCoordinatorV2Interface indexed vrfCoordinator);\n\n /* ============ Constructor ============ */\n\n /**\n * @notice Constructor of the contract\n * @param _owner Owner of the contract\n * @param _vrfCoordinator Address of the VRF Coordinator\n * @param _subscriptionId Chainlink VRF subscription id\n * @param _keyHash Hash of the public key used to verify the VRF proof\n */\n constructor(\n address _owner,\n VRFCoordinatorV2Interface _vrfCoordinator,\n uint64 _subscriptionId,\n bytes32 _keyHash\n ) Ownable(_owner) VRFConsumerBaseV2(address(_vrfCoordinator)) {\n _setVRFCoordinator(_vrfCoordinator);\n _setSubscriptionId(_subscriptionId);\n _setKeyhash(_keyHash);\n }\n\n /* ============ External Functions ============ */\n\n /// @inheritdoc RNGInterface\n function requestRandomNumber()\n external\n override\n onlyManager\n returns (uint32 requestId, uint32 lockBlock)\n {\n uint256 _vrfRequestId = vrfCoordinator.requestRandomWords(\n keyHash,\n subscriptionId,\n 3,\n 1000000,\n 1\n );\n\n requestCounter++;\n uint32 _requestCounter = requestCounter;\n\n requestId = _requestCounter;\n chainlinkRequestIds[_vrfRequestId] = _requestCounter;\n\n lockBlock = uint32(block.number);\n requestLockBlock[_requestCounter] = lockBlock;\n\n emit RandomNumberRequested(_requestCounter, msg.sender);\n }\n\n /// @inheritdoc RNGInterface\n function isRequestComplete(uint32 _internalRequestId)\n external\n view\n override\n returns (bool isCompleted)\n {\n return randomNumbers[_internalRequestId] != 0;\n }\n\n /// @inheritdoc RNGInterface\n function randomNumber(uint32 _internalRequestId)\n external\n view\n override\n returns (uint256 randomNum)\n {\n return randomNumbers[_internalRequestId];\n }\n\n /// @inheritdoc RNGInterface\n function getLastRequestId() external view override returns (uint32 requestId) {\n return requestCounter;\n }\n\n /// @inheritdoc RNGInterface\n function getRequestFee() external pure override returns (address feeToken, uint256 requestFee) {\n return (address(0), 0);\n }\n\n /// @inheritdoc RNGChainlinkV2Interface\n function getKeyHash() external view override returns (bytes32) {\n return keyHash;\n }\n\n /// @inheritdoc RNGChainlinkV2Interface\n function getSubscriptionId() external view override returns (uint64) {\n return subscriptionId;\n }\n\n /// @inheritdoc RNGChainlinkV2Interface\n function getVrfCoordinator() external view override returns (VRFCoordinatorV2Interface) {\n return vrfCoordinator;\n }\n\n /// @inheritdoc RNGChainlinkV2Interface\n function setSubscriptionId(uint64 _subscriptionId) external override onlyOwner {\n _setSubscriptionId(_subscriptionId);\n }\n\n /// @inheritdoc RNGChainlinkV2Interface\n function setKeyhash(bytes32 _keyHash) external override onlyOwner {\n _setKeyhash(_keyHash);\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Callback function called by VRF Coordinator\n * @dev The VRF Coordinator will only call it once it has verified the proof associated with the randomness.\n * @param _vrfRequestId Chainlink VRF request id\n * @param _randomWords Chainlink VRF array of random words\n */\n function fulfillRandomWords(uint256 _vrfRequestId, uint256[] memory _randomWords)\n internal\n override\n {\n uint32 _internalRequestId = chainlinkRequestIds[_vrfRequestId];\n require(_internalRequestId > 0, \"RNGChainLink/requestId-incorrect\");\n\n uint256 _randomNumber = _randomWords[0];\n randomNumbers[_internalRequestId] = _randomNumber;\n\n emit RandomNumberCompleted(_internalRequestId, _randomNumber);\n }\n\n /**\n * @notice Set Chainlink VRF coordinator contract address.\n * @param _vrfCoordinator Chainlink VRF coordinator contract address\n */\n function _setVRFCoordinator(VRFCoordinatorV2Interface _vrfCoordinator) internal {\n require(address(_vrfCoordinator) != address(0), \"RNGChainLink/vrf-not-zero-addr\");\n vrfCoordinator = _vrfCoordinator;\n emit VrfCoordinatorSet(_vrfCoordinator);\n }\n\n /**\n * @notice Set Chainlink VRF subscription id associated with this contract.\n * @param _subscriptionId Chainlink VRF subscription id\n */\n function _setSubscriptionId(uint64 _subscriptionId) internal {\n require(_subscriptionId > 0, \"RNGChainLink/subId-gt-zero\");\n subscriptionId = _subscriptionId;\n emit SubscriptionIdSet(_subscriptionId);\n }\n\n /**\n * @notice Set Chainlink VRF keyHash.\n * @param _keyHash Chainlink VRF keyHash\n */\n function _setKeyhash(bytes32 _keyHash) internal {\n require(_keyHash != bytes32(0), \"RNGChainLink/keyHash-not-empty\");\n keyHash = _keyHash;\n emit KeyHashSet(_keyHash);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface VRFCoordinatorV2Interface {\n /**\n * @notice Get configuration relevant for making requests\n * @return minimumRequestConfirmations global min for request confirmations\n * @return maxGasLimit global max for request gas limit\n * @return s_provingKeyHashes list of registered key hashes\n */\n function getRequestConfig()\n external\n view\n returns (\n uint16,\n uint32,\n bytes32[] memory\n );\n\n /**\n * @notice Request a set of random words.\n * @param keyHash - Corresponds to a particular oracle job which uses\n * that key for generating the VRF proof. Different keyHash's have different gas price\n * ceilings, so you can select a specific one to bound your maximum per request cost.\n * @param subId - The ID of the VRF subscription. Must be funded\n * with the minimum subscription balance required for the selected keyHash.\n * @param minimumRequestConfirmations - How many blocks you'd like the\n * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS\n * for why you may want to request more. The acceptable range is\n * [minimumRequestBlockConfirmations, 200].\n * @param callbackGasLimit - How much gas you'd like to receive in your\n * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords\n * may be slightly less than this amount because of gas used calling the function\n * (argument decoding etc.), so you may need to request slightly more than you expect\n * to have inside fulfillRandomWords. The acceptable range is\n * [0, maxGasLimit]\n * @param numWords - The number of uint256 random values you'd like to receive\n * in your fulfillRandomWords callback. Note these numbers are expanded in a\n * secure way by the VRFCoordinator from a single random value supplied by the oracle.\n * @return requestId - A unique identifier of the request. Can be used to match\n * a request to a response in fulfillRandomWords.\n */\n function requestRandomWords(\n bytes32 keyHash,\n uint64 subId,\n uint16 minimumRequestConfirmations,\n uint32 callbackGasLimit,\n uint32 numWords\n ) external returns (uint256 requestId);\n\n /**\n * @notice Create a VRF subscription.\n * @return subId - A unique subscription id.\n * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.\n * @dev Note to fund the subscription, use transferAndCall. For example\n * @dev LINKTOKEN.transferAndCall(\n * @dev address(COORDINATOR),\n * @dev amount,\n * @dev abi.encode(subId));\n */\n function createSubscription() external returns (uint64 subId);\n\n /**\n * @notice Get a VRF subscription.\n * @param subId - ID of the subscription\n * @return balance - LINK balance of the subscription in juels.\n * @return reqCount - number of requests for this subscription, determines fee tier.\n * @return owner - owner of the subscription.\n * @return consumers - list of consumer address which are able to use this subscription.\n */\n function getSubscription(uint64 subId)\n external\n view\n returns (\n uint96 balance,\n uint64 reqCount,\n address owner,\n address[] memory consumers\n );\n\n /**\n * @notice Request subscription owner transfer.\n * @param subId - ID of the subscription\n * @param newOwner - proposed new owner of the subscription\n */\n function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;\n\n /**\n * @notice Request subscription owner transfer.\n * @param subId - ID of the subscription\n * @dev will revert if original owner of subId has\n * not requested that msg.sender become the new owner.\n */\n function acceptSubscriptionOwnerTransfer(uint64 subId) external;\n\n /**\n * @notice Add a consumer to a VRF subscription.\n * @param subId - ID of the subscription\n * @param consumer - New consumer which can use the subscription\n */\n function addConsumer(uint64 subId, address consumer) external;\n\n /**\n * @notice Remove a consumer from a VRF subscription.\n * @param subId - ID of the subscription\n * @param consumer - Consumer to remove from the subscription\n */\n function removeConsumer(uint64 subId, address consumer) external;\n\n /**\n * @notice Cancel a subscription\n * @param subId - ID of the subscription\n * @param to - Where to send the remaining LINK to\n */\n function cancelSubscription(uint64 subId, address to) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/** ****************************************************************************\n * @notice Interface for contracts using VRF randomness\n * *****************************************************************************\n * @dev PURPOSE\n *\n * @dev Reggie the Random Oracle (not his real job) wants to provide randomness\n * @dev to Vera the verifier in such a way that Vera can be sure he's not\n * @dev making his output up to suit himself. Reggie provides Vera a public key\n * @dev to which he knows the secret key. Each time Vera provides a seed to\n * @dev Reggie, he gives back a value which is computed completely\n * @dev deterministically from the seed and the secret key.\n *\n * @dev Reggie provides a proof by which Vera can verify that the output was\n * @dev correctly computed once Reggie tells it to her, but without that proof,\n * @dev the output is indistinguishable to her from a uniform random sample\n * @dev from the output space.\n *\n * @dev The purpose of this contract is to make it easy for unrelated contracts\n * @dev to talk to Vera the verifier about the work Reggie is doing, to provide\n * @dev simple access to a verifiable source of randomness. It ensures 2 things:\n * @dev 1. The fulfillment came from the VRFCoordinator\n * @dev 2. The consumer contract implements fulfillRandomWords.\n * *****************************************************************************\n * @dev USAGE\n *\n * @dev Calling contracts must inherit from VRFConsumerBase, and can\n * @dev initialize VRFConsumerBase's attributes in their constructor as\n * @dev shown:\n *\n * @dev contract VRFConsumer {\n * @dev constructor(, address _vrfCoordinator, address _link)\n * @dev VRFConsumerBase(_vrfCoordinator) public {\n * @dev \n * @dev }\n * @dev }\n *\n * @dev The oracle will have given you an ID for the VRF keypair they have\n * @dev committed to (let's call it keyHash). Create subscription, fund it\n * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface\n * @dev subscription management functions).\n * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,\n * @dev callbackGasLimit, numWords),\n * @dev see (VRFCoordinatorInterface for a description of the arguments).\n *\n * @dev Once the VRFCoordinator has received and validated the oracle's response\n * @dev to your request, it will call your contract's fulfillRandomWords method.\n *\n * @dev The randomness argument to fulfillRandomWords is a set of random words\n * @dev generated from your requestId and the blockHash of the request.\n *\n * @dev If your contract could have concurrent requests open, you can use the\n * @dev requestId returned from requestRandomWords to track which response is associated\n * @dev with which randomness request.\n * @dev See \"SECURITY CONSIDERATIONS\" for principles to keep in mind,\n * @dev if your contract could have multiple requests in flight simultaneously.\n *\n * @dev Colliding `requestId`s are cryptographically impossible as long as seeds\n * @dev differ.\n *\n * *****************************************************************************\n * @dev SECURITY CONSIDERATIONS\n *\n * @dev A method with the ability to call your fulfillRandomness method directly\n * @dev could spoof a VRF response with any random value, so it's critical that\n * @dev it cannot be directly called by anything other than this base contract\n * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).\n *\n * @dev For your users to trust that your contract's random behavior is free\n * @dev from malicious interference, it's best if you can write it so that all\n * @dev behaviors implied by a VRF response are executed *during* your\n * @dev fulfillRandomness method. If your contract must store the response (or\n * @dev anything derived from it) and use it later, you must ensure that any\n * @dev user-significant behavior which depends on that stored value cannot be\n * @dev manipulated by a subsequent VRF request.\n *\n * @dev Similarly, both miners and the VRF oracle itself have some influence\n * @dev over the order in which VRF responses appear on the blockchain, so if\n * @dev your contract could have multiple VRF requests in flight simultaneously,\n * @dev you must ensure that the order in which the VRF responses arrive cannot\n * @dev be used to manipulate your contract's user-significant behavior.\n *\n * @dev Since the block hash of the block which contains the requestRandomness\n * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful\n * @dev miner could, in principle, fork the blockchain to evict the block\n * @dev containing the request, forcing the request to be included in a\n * @dev different block with a different hash, and therefore a different input\n * @dev to the VRF. However, such an attack would incur a substantial economic\n * @dev cost. This cost scales with the number of blocks the VRF oracle waits\n * @dev until it calls responds to a request. It is for this reason that\n * @dev that you can signal to an oracle you'd like them to wait longer before\n * @dev responding to the request (however this is not enforced in the contract\n * @dev and so remains effective only in the case of unmodified oracle software).\n */\nabstract contract VRFConsumerBaseV2 {\n error OnlyCoordinatorCanFulfill(address have, address want);\n address private immutable vrfCoordinator;\n\n /**\n * @param _vrfCoordinator address of VRFCoordinator contract\n */\n constructor(address _vrfCoordinator) {\n vrfCoordinator = _vrfCoordinator;\n }\n\n /**\n * @notice fulfillRandomness handles the VRF response. Your contract must\n * @notice implement it. See \"SECURITY CONSIDERATIONS\" above for important\n * @notice principles to keep in mind when implementing your fulfillRandomness\n * @notice method.\n *\n * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this\n * @dev signature, and will call it once it has verified the proof\n * @dev associated with the randomness. (It is triggered via a call to\n * @dev rawFulfillRandomness, below.)\n *\n * @param requestId The Id initially returned by requestRandomness\n * @param randomWords the VRF output expanded to the requested number of words\n */\n function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;\n\n // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF\n // proof. rawFulfillRandomness then calls fulfillRandomness, after validating\n // the origin of the call\n function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {\n if (msg.sender != vrfCoordinator) {\n revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);\n }\n fulfillRandomWords(requestId, randomWords);\n }\n}\n" + }, + "@pooltogether/owner-manager-contracts/contracts/Manageable.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"./Ownable.sol\";\n\n/**\n * @title Abstract manageable contract that can be inherited by other contracts\n * @notice Contract module based on Ownable which provides a basic access control mechanism, where\n * there is an owner and a manager that can be granted exclusive access to specific functions.\n *\n * By default, the owner is the deployer of the contract.\n *\n * The owner account is set through a two steps process.\n * 1. The current `owner` calls {transferOwnership} to set a `pendingOwner`\n * 2. The `pendingOwner` calls {acceptOwnership} to accept the ownership transfer\n *\n * The manager account needs to be set using {setManager}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyManager`, which can be applied to your functions to restrict their use to\n * the manager.\n */\nabstract contract Manageable is Ownable {\n address private _manager;\n\n /**\n * @dev Emitted when `_manager` has been changed.\n * @param previousManager previous `_manager` address.\n * @param newManager new `_manager` address.\n */\n event ManagerTransferred(address indexed previousManager, address indexed newManager);\n\n /* ============ External Functions ============ */\n\n /**\n * @notice Gets current `_manager`.\n * @return Current `_manager` address.\n */\n function manager() public view virtual returns (address) {\n return _manager;\n }\n\n /**\n * @notice Set or change of manager.\n * @dev Throws if called by any account other than the owner.\n * @param _newManager New _manager address.\n * @return Boolean to indicate if the operation was successful or not.\n */\n function setManager(address _newManager) external onlyOwner returns (bool) {\n return _setManager(_newManager);\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Set or change of manager.\n * @param _newManager New _manager address.\n * @return Boolean to indicate if the operation was successful or not.\n */\n function _setManager(address _newManager) private returns (bool) {\n address _previousManager = _manager;\n\n require(_newManager != _previousManager, \"Manageable/existing-manager-address\");\n\n _manager = _newManager;\n\n emit ManagerTransferred(_previousManager, _newManager);\n return true;\n }\n\n /* ============ Modifier Functions ============ */\n\n /**\n * @dev Throws if called by any account other than the manager.\n */\n modifier onlyManager() {\n require(manager() == msg.sender, \"Manageable/caller-not-manager\");\n _;\n }\n\n /**\n * @dev Throws if called by any account other than the manager or the owner.\n */\n modifier onlyManagerOrOwner() {\n require(manager() == msg.sender || owner() == msg.sender, \"Manageable/caller-not-manager-or-owner\");\n _;\n }\n}\n" + }, + "@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2Interface.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol\";\n\nimport \"./RNGInterface.sol\";\n\n/**\n * @title RNG Chainlink V2 Interface\n * @notice Provides an interface for requesting random numbers from Chainlink VRF V2.\n */\ninterface RNGChainlinkV2Interface is RNGInterface {\n /**\n * @notice Get Chainlink VRF keyHash associated with this contract.\n * @return bytes32 Chainlink VRF keyHash\n */\n function getKeyHash() external view returns (bytes32);\n\n /**\n * @notice Get Chainlink VRF subscription id associated with this contract.\n * @return uint64 Chainlink VRF subscription id\n */\n function getSubscriptionId() external view returns (uint64);\n\n /**\n * @notice Get Chainlink VRF coordinator contract address associated with this contract.\n * @return address Chainlink VRF coordinator address\n */\n function getVrfCoordinator() external view returns (VRFCoordinatorV2Interface);\n\n /**\n * @notice Set Chainlink VRF keyHash.\n * @dev This function is only callable by the owner.\n * @param keyHash Chainlink VRF keyHash\n */\n function setKeyhash(bytes32 keyHash) external;\n\n /**\n * @notice Set Chainlink VRF subscription id associated with this contract.\n * @dev This function is only callable by the owner.\n * @param subscriptionId Chainlink VRF subscription id\n */\n function setSubscriptionId(uint64 subscriptionId) external;\n}\n" + }, + "@pooltogether/owner-manager-contracts/contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\n/**\n * @title Abstract ownable contract that can be inherited by other contracts\n * @notice Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner is the deployer of the contract.\n *\n * The owner account is set through a two steps process.\n * 1. The current `owner` calls {transferOwnership} to set a `pendingOwner`\n * 2. The `pendingOwner` calls {acceptOwnership} to accept the ownership transfer\n *\n * The manager account needs to be set using {setManager}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable {\n address private _owner;\n address private _pendingOwner;\n\n /**\n * @dev Emitted when `_pendingOwner` has been changed.\n * @param pendingOwner new `_pendingOwner` address.\n */\n event OwnershipOffered(address indexed pendingOwner);\n\n /**\n * @dev Emitted when `_owner` has been changed.\n * @param previousOwner previous `_owner` address.\n * @param newOwner new `_owner` address.\n */\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /* ============ Deploy ============ */\n\n /**\n * @notice Initializes the contract setting `_initialOwner` as the initial owner.\n * @param _initialOwner Initial owner of the contract.\n */\n constructor(address _initialOwner) {\n _setOwner(_initialOwner);\n }\n\n /* ============ External Functions ============ */\n\n /**\n * @notice Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @notice Gets current `_pendingOwner`.\n * @return Current `_pendingOwner` address.\n */\n function pendingOwner() external view virtual returns (address) {\n return _pendingOwner;\n }\n\n /**\n * @notice Renounce ownership of the contract.\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() external virtual onlyOwner {\n _setOwner(address(0));\n }\n\n /**\n * @notice Allows current owner to set the `_pendingOwner` address.\n * @param _newOwner Address to transfer ownership to.\n */\n function transferOwnership(address _newOwner) external onlyOwner {\n require(_newOwner != address(0), \"Ownable/pendingOwner-not-zero-address\");\n\n _pendingOwner = _newOwner;\n\n emit OwnershipOffered(_newOwner);\n }\n\n /**\n * @notice Allows the `_pendingOwner` address to finalize the transfer.\n * @dev This function is only callable by the `_pendingOwner`.\n */\n function claimOwnership() external onlyPendingOwner {\n _setOwner(_pendingOwner);\n _pendingOwner = address(0);\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Internal function to set the `_owner` of the contract.\n * @param _newOwner New `_owner` address.\n */\n function _setOwner(address _newOwner) private {\n address _oldOwner = _owner;\n _owner = _newOwner;\n emit OwnershipTransferred(_oldOwner, _newOwner);\n }\n\n /* ============ Modifier Functions ============ */\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == msg.sender, \"Ownable/caller-not-owner\");\n _;\n }\n\n /**\n * @dev Throws if called by any account other than the `pendingOwner`.\n */\n modifier onlyPendingOwner() {\n require(msg.sender == _pendingOwner, \"Ownable/caller-not-pendingOwner\");\n _;\n }\n}\n" + }, + "@pooltogether/pooltogether-rng-contracts/contracts/RNGInterface.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\n/**\n * @title Random Number Generator Interface\n * @notice Provides an interface for requesting random numbers from 3rd-party RNG services (Chainlink VRF, Starkware VDF, etc..)\n */\ninterface RNGInterface {\n /**\n * @notice Emitted when a new request for a random number has been submitted\n * @param requestId The indexed ID of the request used to get the results of the RNG service\n * @param sender The indexed address of the sender of the request\n */\n event RandomNumberRequested(uint32 indexed requestId, address indexed sender);\n\n /**\n * @notice Emitted when an existing request for a random number has been completed\n * @param requestId The indexed ID of the request used to get the results of the RNG service\n * @param randomNumber The random number produced by the 3rd-party service\n */\n event RandomNumberCompleted(uint32 indexed requestId, uint256 randomNumber);\n\n /**\n * @notice Gets the last request id used by the RNG service\n * @return requestId The last request id used in the last request\n */\n function getLastRequestId() external view returns (uint32 requestId);\n\n /**\n * @notice Gets the Fee for making a Request against an RNG service\n * @return feeToken The address of the token that is used to pay fees\n * @return requestFee The fee required to be paid to make a request\n */\n function getRequestFee() external view returns (address feeToken, uint256 requestFee);\n\n /**\n * @notice Sends a request for a random number to the 3rd-party service\n * @dev Some services will complete the request immediately, others may have a time-delay\n * @dev Some services require payment in the form of a token, such as $LINK for Chainlink VRF\n * @return requestId The ID of the request used to get the results of the RNG service\n * @return lockBlock The block number at which the RNG service will start generating time-delayed randomness.\n * The calling contract should \"lock\" all activity until the result is available via the `requestId`\n */\n function requestRandomNumber() external returns (uint32 requestId, uint32 lockBlock);\n\n /**\n * @notice Checks if the request for randomness from the 3rd-party service has completed\n * @dev For time-delayed requests, this function is used to check/confirm completion\n * @param requestId The ID of the request used to get the results of the RNG service\n * @return isCompleted True if the request has completed and a random number is available, false otherwise\n */\n function isRequestComplete(uint32 requestId) external view returns (bool isCompleted);\n\n /**\n * @notice Gets the random number produced by the 3rd-party service\n * @param requestId The ID of the request used to get the results of the RNG service\n * @return randomNum The random number\n */\n function randomNumber(uint32 requestId) external returns (uint256 randomNum);\n}\n" + }, + "@pooltogether/v4-core/contracts/interfaces/IDrawBeacon.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@pooltogether/pooltogether-rng-contracts/contracts/RNGInterface.sol\";\nimport \"./IDrawBuffer.sol\";\n\n/** @title IDrawBeacon\n * @author PoolTogether Inc Team\n * @notice The DrawBeacon interface.\n*/\ninterface IDrawBeacon {\n\n /// @notice Draw struct created every draw\n /// @param winningRandomNumber The random number returned from the RNG service\n /// @param drawId The monotonically increasing drawId for each draw\n /// @param timestamp Unix timestamp of the draw. Recorded when the draw is created by the DrawBeacon.\n /// @param beaconPeriodStartedAt Unix timestamp of when the draw started\n /// @param beaconPeriodSeconds Unix timestamp of the beacon draw period for this draw.\n struct Draw {\n uint256 winningRandomNumber;\n uint32 drawId;\n uint64 timestamp;\n uint64 beaconPeriodStartedAt;\n uint32 beaconPeriodSeconds;\n }\n\n /**\n * @notice Emit when a new DrawBuffer has been set.\n * @param newDrawBuffer The new DrawBuffer address\n */\n event DrawBufferUpdated(IDrawBuffer indexed newDrawBuffer);\n\n /**\n * @notice Emit when a draw has opened.\n * @param startedAt Start timestamp\n */\n event BeaconPeriodStarted(uint64 indexed startedAt);\n\n /**\n * @notice Emit when a draw has started.\n * @param rngRequestId draw id\n * @param rngLockBlock Block when draw becomes invalid\n */\n event DrawStarted(uint32 indexed rngRequestId, uint32 rngLockBlock);\n\n /**\n * @notice Emit when a draw has been cancelled.\n * @param rngRequestId draw id\n * @param rngLockBlock Block when draw becomes invalid\n */\n event DrawCancelled(uint32 indexed rngRequestId, uint32 rngLockBlock);\n\n /**\n * @notice Emit when a draw has been completed.\n * @param randomNumber Random number generated from draw\n */\n event DrawCompleted(uint256 randomNumber);\n\n /**\n * @notice Emit when a RNG service address is set.\n * @param rngService RNG service address\n */\n event RngServiceUpdated(RNGInterface indexed rngService);\n\n /**\n * @notice Emit when a draw timeout param is set.\n * @param rngTimeout draw timeout param in seconds\n */\n event RngTimeoutSet(uint32 rngTimeout);\n\n /**\n * @notice Emit when the drawPeriodSeconds is set.\n * @param drawPeriodSeconds Time between draw\n */\n event BeaconPeriodSecondsUpdated(uint32 drawPeriodSeconds);\n\n /**\n * @notice Returns the number of seconds remaining until the beacon period can be complete.\n * @return The number of seconds remaining until the beacon period can be complete.\n */\n function beaconPeriodRemainingSeconds() external view returns (uint64);\n\n /**\n * @notice Returns the timestamp at which the beacon period ends\n * @return The timestamp at which the beacon period ends.\n */\n function beaconPeriodEndAt() external view returns (uint64);\n\n /**\n * @notice Returns whether a Draw can be started.\n * @return True if a Draw can be started, false otherwise.\n */\n function canStartDraw() external view returns (bool);\n\n /**\n * @notice Returns whether a Draw can be completed.\n * @return True if a Draw can be completed, false otherwise.\n */\n function canCompleteDraw() external view returns (bool);\n\n /**\n * @notice Calculates when the next beacon period will start.\n * @param time The timestamp to use as the current time\n * @return The timestamp at which the next beacon period would start\n */\n function calculateNextBeaconPeriodStartTime(uint64 time) external view returns (uint64);\n\n /**\n * @notice Can be called by anyone to cancel the draw request if the RNG has timed out.\n */\n function cancelDraw() external;\n\n /**\n * @notice Completes the Draw (RNG) request and pushes a Draw onto DrawBuffer.\n */\n function completeDraw() external;\n\n /**\n * @notice Returns the block number that the current RNG request has been locked to.\n * @return The block number that the RNG request is locked to\n */\n function getLastRngLockBlock() external view returns (uint32);\n\n /**\n * @notice Returns the current RNG Request ID.\n * @return The current Request ID\n */\n function getLastRngRequestId() external view returns (uint32);\n\n /**\n * @notice Returns whether the beacon period is over\n * @return True if the beacon period is over, false otherwise\n */\n function isBeaconPeriodOver() external view returns (bool);\n\n /**\n * @notice Returns whether the random number request has completed.\n * @return True if a random number request has completed, false otherwise.\n */\n function isRngCompleted() external view returns (bool);\n\n /**\n * @notice Returns whether a random number has been requested\n * @return True if a random number has been requested, false otherwise.\n */\n function isRngRequested() external view returns (bool);\n\n /**\n * @notice Returns whether the random number request has timed out.\n * @return True if a random number request has timed out, false otherwise.\n */\n function isRngTimedOut() external view returns (bool);\n\n /**\n * @notice Allows the owner to set the beacon period in seconds.\n * @param beaconPeriodSeconds The new beacon period in seconds. Must be greater than zero.\n */\n function setBeaconPeriodSeconds(uint32 beaconPeriodSeconds) external;\n\n /**\n * @notice Allows the owner to set the RNG request timeout in seconds. This is the time that must elapsed before the RNG request can be cancelled and the pool unlocked.\n * @param rngTimeout The RNG request timeout in seconds.\n */\n function setRngTimeout(uint32 rngTimeout) external;\n\n /**\n * @notice Sets the RNG service that the Prize Strategy is connected to\n * @param rngService The address of the new RNG service interface\n */\n function setRngService(RNGInterface rngService) external;\n\n /**\n * @notice Starts the Draw process by starting random number request. The previous beacon period must have ended.\n * @dev The RNG-Request-Fee is expected to be held within this contract before calling this function\n */\n function startDraw() external;\n\n /**\n * @notice Set global DrawBuffer variable.\n * @dev All subsequent Draw requests/completions will be pushed to the new DrawBuffer.\n * @param newDrawBuffer DrawBuffer address\n * @return DrawBuffer\n */\n function setDrawBuffer(IDrawBuffer newDrawBuffer) external returns (IDrawBuffer);\n}\n" + }, + "@pooltogether/v4-core/contracts/interfaces/IDrawBuffer.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"../interfaces/IDrawBeacon.sol\";\n\n/** @title IDrawBuffer\n * @author PoolTogether Inc Team\n * @notice The DrawBuffer interface.\n*/\ninterface IDrawBuffer {\n /**\n * @notice Emit when a new draw has been created.\n * @param drawId Draw id\n * @param draw The Draw struct\n */\n event DrawSet(uint32 indexed drawId, IDrawBeacon.Draw draw);\n\n /**\n * @notice Read a ring buffer cardinality\n * @return Ring buffer cardinality\n */\n function getBufferCardinality() external view returns (uint32);\n\n /**\n * @notice Read a Draw from the draws ring buffer.\n * @dev Read a Draw using the Draw.drawId to calculate position in the draws ring buffer.\n * @param drawId Draw.drawId\n * @return IDrawBeacon.Draw\n */\n function getDraw(uint32 drawId) external view returns (IDrawBeacon.Draw memory);\n\n /**\n * @notice Read multiple Draws from the draws ring buffer.\n * @dev Read multiple Draws using each drawId to calculate position in the draws ring buffer.\n * @param drawIds Array of drawIds\n * @return IDrawBeacon.Draw[]\n */\n function getDraws(uint32[] calldata drawIds) external view returns (IDrawBeacon.Draw[] memory);\n\n /**\n * @notice Gets the number of Draws held in the draw ring buffer.\n * @dev If no Draws have been pushed, it will return 0.\n * @dev If the ring buffer is full, it will return the cardinality.\n * @dev Otherwise, it will return the NewestDraw index + 1.\n * @return Number of Draws held in the draw ring buffer.\n */\n function getDrawCount() external view returns (uint32);\n\n /**\n * @notice Read newest Draw from draws ring buffer.\n * @dev Uses the nextDrawIndex to calculate the most recently added Draw.\n * @return IDrawBeacon.Draw\n */\n function getNewestDraw() external view returns (IDrawBeacon.Draw memory);\n\n /**\n * @notice Read oldest Draw from draws ring buffer.\n * @dev Finds the oldest Draw by comparing and/or diffing totalDraws with the cardinality.\n * @return IDrawBeacon.Draw\n */\n function getOldestDraw() external view returns (IDrawBeacon.Draw memory);\n\n /**\n * @notice Push Draw onto draws ring buffer history.\n * @dev Push new draw onto draws history via authorized manager or owner.\n * @param draw IDrawBeacon.Draw\n * @return Draw.drawId\n */\n function pushDraw(IDrawBeacon.Draw calldata draw) external returns (uint32);\n\n /**\n * @notice Set existing Draw in draws ring buffer with new parameters.\n * @dev Updating a Draw should be used sparingly and only in the event an incorrect Draw parameter has been stored.\n * @param newDraw IDrawBeacon.Draw\n * @return Draw.drawId\n */\n function setDraw(IDrawBeacon.Draw calldata newDraw) external returns (uint32);\n}\n" + }, + "@pooltogether/v4-timelocks/contracts/interfaces/IReceiverTimelockTrigger.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.6;\nimport \"@pooltogether/v4-core/contracts/interfaces/IDrawBeacon.sol\";\nimport \"@pooltogether/v4-core/contracts/interfaces/IDrawBuffer.sol\";\nimport \"./IPrizeDistributionFactory.sol\";\nimport \"./IDrawCalculatorTimelock.sol\";\n\n/**\n * @title PoolTogether V4 IReceiverTimelockTrigger\n * @author PoolTogether Inc Team\n * @notice The IReceiverTimelockTrigger smart contract interface...\n */\ninterface IReceiverTimelockTrigger {\n /// @notice Emitted when the contract is deployed.\n event Deployed(\n IDrawBuffer indexed drawBuffer,\n IPrizeDistributionFactory indexed prizeDistributionFactory,\n IDrawCalculatorTimelock indexed timelock\n );\n\n /**\n * @notice Emitted when Draw is locked, pushed to Draw DrawBuffer and totalNetworkTicketSupply is pushed to PrizeDistributionFactory\n * @param drawId Draw ID\n * @param draw Draw\n * @param totalNetworkTicketSupply totalNetworkTicketSupply\n */\n event DrawLockedPushedAndTotalNetworkTicketSupplyPushed(\n uint32 indexed drawId,\n IDrawBeacon.Draw draw,\n uint256 totalNetworkTicketSupply\n );\n\n /**\n * @notice Locks next Draw, pushes Draw to DraWBuffer and pushes totalNetworkTicketSupply to PrizeDistributionFactory.\n * @dev Restricts new draws for N seconds by forcing timelock on the next target draw id.\n * @param draw Draw\n * @param totalNetworkTicketSupply totalNetworkTicketSupply\n */\n function push(IDrawBeacon.Draw memory draw, uint256 totalNetworkTicketSupply) external;\n}\n" + }, + "@pooltogether/v4-timelocks/contracts/interfaces/IPrizeDistributionFactory.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.6;\n\ninterface IPrizeDistributionFactory {\n function pushPrizeDistribution(uint32 _drawId, uint256 _totalNetworkTicketSupply) external;\n}\n" + }, + "@pooltogether/v4-timelocks/contracts/interfaces/IDrawCalculatorTimelock.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@pooltogether/v4-core/contracts/interfaces/IDrawCalculator.sol\";\n\ninterface IDrawCalculatorTimelock {\n /**\n * @notice Emitted when target draw id is locked.\n * @param timestamp The epoch timestamp to unlock the current locked Draw\n * @param drawId The Draw to unlock\n */\n struct Timelock {\n uint64 timestamp;\n uint32 drawId;\n }\n\n /**\n * @notice Emitted when target draw id is locked.\n * @param drawId Draw ID\n * @param timestamp Block timestamp\n */\n event LockedDraw(uint32 indexed drawId, uint64 timestamp);\n\n /**\n * @notice Emitted event when the timelock struct is updated\n * @param timelock Timelock struct set\n */\n event TimelockSet(Timelock timelock);\n\n /**\n * @notice Routes claim/calculate requests between PrizeDistributor and DrawCalculator.\n * @dev Will enforce a \"cooldown\" period between when a Draw is pushed and when users can start to claim prizes.\n * @param user User address\n * @param drawIds Draw.drawId\n * @param data Encoded pick indices\n * @return Prizes awardable array\n */\n function calculate(\n address user,\n uint32[] calldata drawIds,\n bytes calldata data\n ) external view returns (uint256[] memory, bytes memory);\n\n /**\n * @notice Lock passed draw id for `timelockDuration` seconds.\n * @dev Restricts new draws by forcing a push timelock.\n * @param _drawId Draw id to lock.\n * @param _timestamp Epoch timestamp to unlock the draw.\n * @return True if operation was successful.\n */\n function lock(uint32 _drawId, uint64 _timestamp) external returns (bool);\n\n /**\n * @notice Read internal DrawCalculator variable.\n * @return IDrawCalculator\n */\n function getDrawCalculator() external view returns (IDrawCalculator);\n\n /**\n * @notice Read internal Timelock struct.\n * @return Timelock\n */\n function getTimelock() external view returns (Timelock memory);\n\n /**\n * @notice Set the Timelock struct. Only callable by the contract owner.\n * @param _timelock Timelock struct to set.\n */\n function setTimelock(Timelock memory _timelock) external;\n\n /**\n * @notice Returns bool for timelockDuration elapsing.\n * @return True if timelockDuration, since last timelock has elapsed, false otherwise.\n */\n function hasElapsed() external view returns (bool);\n}\n" + }, + "@pooltogether/v4-core/contracts/interfaces/IDrawCalculator.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"./ITicket.sol\";\nimport \"./IDrawBuffer.sol\";\nimport \"../PrizeDistributionBuffer.sol\";\nimport \"../PrizeDistributor.sol\";\n\n/**\n * @title PoolTogether V4 IDrawCalculator\n * @author PoolTogether Inc Team\n * @notice The DrawCalculator interface.\n */\ninterface IDrawCalculator {\n struct PickPrize {\n bool won;\n uint8 tierIndex;\n }\n\n ///@notice Emitted when the contract is initialized\n event Deployed(\n ITicket indexed ticket,\n IDrawBuffer indexed drawBuffer,\n IPrizeDistributionBuffer indexed prizeDistributionBuffer\n );\n\n ///@notice Emitted when the prizeDistributor is set/updated\n event PrizeDistributorSet(PrizeDistributor indexed prizeDistributor);\n\n /**\n * @notice Calculates the prize amount for a user for Multiple Draws. Typically called by a PrizeDistributor.\n * @param user User for which to calculate prize amount.\n * @param drawIds drawId array for which to calculate prize amounts for.\n * @param data The ABI encoded pick indices for all Draws. Expected to be winning picks. Pick indices must be less than the totalUserPicks.\n * @return List of awardable prize amounts ordered by drawId.\n */\n function calculate(\n address user,\n uint32[] calldata drawIds,\n bytes calldata data\n ) external view returns (uint256[] memory, bytes memory);\n\n /**\n * @notice Read global DrawBuffer variable.\n * @return IDrawBuffer\n */\n function getDrawBuffer() external view returns (IDrawBuffer);\n\n /**\n * @notice Read global prizeDistributionBuffer variable.\n * @return IPrizeDistributionBuffer\n */\n function getPrizeDistributionBuffer() external view returns (IPrizeDistributionBuffer);\n\n /**\n * @notice Returns a users balances expressed as a fraction of the total supply over time.\n * @param user The users address\n * @param drawIds The drawIds to consider\n * @return Array of balances\n */\n function getNormalizedBalancesForDrawIds(address user, uint32[] calldata drawIds)\n external\n view\n returns (uint256[] memory);\n\n}\n" + }, + "@pooltogether/v4-core/contracts/interfaces/ITicket.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"../libraries/TwabLib.sol\";\nimport \"./IControlledToken.sol\";\n\ninterface ITicket is IControlledToken {\n /**\n * @notice A struct containing details for an Account.\n * @param balance The current balance for an Account.\n * @param nextTwabIndex The next available index to store a new twab.\n * @param cardinality The number of recorded twabs (plus one!).\n */\n struct AccountDetails {\n uint224 balance;\n uint16 nextTwabIndex;\n uint16 cardinality;\n }\n\n /**\n * @notice Combines account details with their twab history.\n * @param details The account details.\n * @param twabs The history of twabs for this account.\n */\n struct Account {\n AccountDetails details;\n ObservationLib.Observation[65535] twabs;\n }\n\n /**\n * @notice Emitted when TWAB balance has been delegated to another user.\n * @param delegator Address of the delegator.\n * @param delegate Address of the delegate.\n */\n event Delegated(address indexed delegator, address indexed delegate);\n\n /**\n * @notice Emitted when ticket is initialized.\n * @param name Ticket name (eg: PoolTogether Dai Ticket (Compound)).\n * @param symbol Ticket symbol (eg: PcDAI).\n * @param decimals Ticket decimals.\n * @param controller Token controller address.\n */\n event TicketInitialized(string name, string symbol, uint8 decimals, address indexed controller);\n\n /**\n * @notice Emitted when a new TWAB has been recorded.\n * @param delegate The recipient of the ticket power (may be the same as the user).\n * @param newTwab Updated TWAB of a ticket holder after a successful TWAB recording.\n */\n event NewUserTwab(\n address indexed delegate,\n ObservationLib.Observation newTwab\n );\n\n /**\n * @notice Emitted when a new total supply TWAB has been recorded.\n * @param newTotalSupplyTwab Updated TWAB of tickets total supply after a successful total supply TWAB recording.\n */\n event NewTotalSupplyTwab(ObservationLib.Observation newTotalSupplyTwab);\n\n /**\n * @notice Retrieves the address of the delegate to whom `user` has delegated their tickets.\n * @dev Address of the delegate will be the zero address if `user` has not delegated their tickets.\n * @param user Address of the delegator.\n * @return Address of the delegate.\n */\n function delegateOf(address user) external view returns (address);\n\n /**\n * @notice Delegate time-weighted average balances to an alternative address.\n * @dev Transfers (including mints) trigger the storage of a TWAB in delegate(s) account, instead of the\n targetted sender and/or recipient address(s).\n * @dev To reset the delegate, pass the zero address (0x000.000) as `to` parameter.\n * @dev Current delegate address should be different from the new delegate address `to`.\n * @param to Recipient of delegated TWAB.\n */\n function delegate(address to) external;\n\n /**\n * @notice Allows the controller to delegate on a users behalf.\n * @param user The user for whom to delegate\n * @param delegate The new delegate\n */\n function controllerDelegateFor(address user, address delegate) external;\n\n /**\n * @notice Allows a user to delegate via signature\n * @param user The user who is delegating\n * @param delegate The new delegate\n * @param deadline The timestamp by which this must be submitted\n * @param v The v portion of the ECDSA sig\n * @param r The r portion of the ECDSA sig\n * @param s The s portion of the ECDSA sig\n */\n function delegateWithSignature(\n address user,\n address delegate,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @notice Gets a users twab context. This is a struct with their balance, next twab index, and cardinality.\n * @param user The user for whom to fetch the TWAB context.\n * @return The TWAB context, which includes { balance, nextTwabIndex, cardinality }\n */\n function getAccountDetails(address user) external view returns (TwabLib.AccountDetails memory);\n\n /**\n * @notice Gets the TWAB at a specific index for a user.\n * @param user The user for whom to fetch the TWAB.\n * @param index The index of the TWAB to fetch.\n * @return The TWAB, which includes the twab amount and the timestamp.\n */\n function getTwab(address user, uint16 index)\n external\n view\n returns (ObservationLib.Observation memory);\n\n /**\n * @notice Retrieves `user` TWAB balance.\n * @param user Address of the user whose TWAB is being fetched.\n * @param timestamp Timestamp at which we want to retrieve the TWAB balance.\n * @return The TWAB balance at the given timestamp.\n */\n function getBalanceAt(address user, uint64 timestamp) external view returns (uint256);\n\n /**\n * @notice Retrieves `user` TWAB balances.\n * @param user Address of the user whose TWABs are being fetched.\n * @param timestamps Timestamps range at which we want to retrieve the TWAB balances.\n * @return `user` TWAB balances.\n */\n function getBalancesAt(address user, uint64[] calldata timestamps)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @notice Retrieves the average balance held by a user for a given time frame.\n * @param user The user whose balance is checked.\n * @param startTime The start time of the time frame.\n * @param endTime The end time of the time frame.\n * @return The average balance that the user held during the time frame.\n */\n function getAverageBalanceBetween(\n address user,\n uint64 startTime,\n uint64 endTime\n ) external view returns (uint256);\n\n /**\n * @notice Retrieves the average balances held by a user for a given time frame.\n * @param user The user whose balance is checked.\n * @param startTimes The start time of the time frame.\n * @param endTimes The end time of the time frame.\n * @return The average balance that the user held during the time frame.\n */\n function getAverageBalancesBetween(\n address user,\n uint64[] calldata startTimes,\n uint64[] calldata endTimes\n ) external view returns (uint256[] memory);\n\n /**\n * @notice Retrieves the total supply TWAB balance at the given timestamp.\n * @param timestamp Timestamp at which we want to retrieve the total supply TWAB balance.\n * @return The total supply TWAB balance at the given timestamp.\n */\n function getTotalSupplyAt(uint64 timestamp) external view returns (uint256);\n\n /**\n * @notice Retrieves the total supply TWAB balance between the given timestamps range.\n * @param timestamps Timestamps range at which we want to retrieve the total supply TWAB balance.\n * @return Total supply TWAB balances.\n */\n function getTotalSuppliesAt(uint64[] calldata timestamps)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @notice Retrieves the average total supply balance for a set of given time frames.\n * @param startTimes Array of start times.\n * @param endTimes Array of end times.\n * @return The average total supplies held during the time frame.\n */\n function getAverageTotalSuppliesBetween(\n uint64[] calldata startTimes,\n uint64[] calldata endTimes\n ) external view returns (uint256[] memory);\n}\n" + }, + "@pooltogether/v4-core/contracts/PrizeDistributionBuffer.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\";\n\nimport \"./libraries/DrawRingBufferLib.sol\";\nimport \"./interfaces/IPrizeDistributionBuffer.sol\";\n\n/**\n * @title PoolTogether V4 PrizeDistributionBuffer\n * @author PoolTogether Inc Team\n * @notice The PrizeDistributionBuffer contract provides historical lookups of PrizeDistribution struct parameters (linked with a Draw ID) via a\n circular ring buffer. Historical PrizeDistribution parameters can be accessed on-chain using a drawId to calculate\n ring buffer storage slot. The PrizeDistribution parameters can be created by manager/owner and existing PrizeDistribution\n parameters can only be updated the owner. When adding a new PrizeDistribution basic sanity checks will be used to\n validate the incoming parameters.\n*/\ncontract PrizeDistributionBuffer is IPrizeDistributionBuffer, Manageable {\n using DrawRingBufferLib for DrawRingBufferLib.Buffer;\n\n /// @notice The maximum cardinality of the prize distribution ring buffer.\n /// @dev even with daily draws, 256 will give us over 8 months of history.\n uint256 internal constant MAX_CARDINALITY = 256;\n\n /// @notice The ceiling for prize distributions. 1e9 = 100%.\n /// @dev It's fixed point 9 because 1e9 is the largest \"1\" that fits into 2**32\n uint256 internal constant TIERS_CEILING = 1e9;\n\n /// @notice Emitted when the contract is deployed.\n /// @param cardinality The maximum number of records in the buffer before they begin to expire.\n event Deployed(uint8 cardinality);\n\n /// @notice PrizeDistribution ring buffer history.\n IPrizeDistributionBuffer.PrizeDistribution[MAX_CARDINALITY]\n internal prizeDistributionRingBuffer;\n\n /// @notice Ring buffer metadata (nextIndex, lastId, cardinality)\n DrawRingBufferLib.Buffer internal bufferMetadata;\n\n /* ============ Constructor ============ */\n\n /**\n * @notice Constructor for PrizeDistributionBuffer\n * @param _owner Address of the PrizeDistributionBuffer owner\n * @param _cardinality Cardinality of the `bufferMetadata`\n */\n constructor(address _owner, uint8 _cardinality) Ownable(_owner) {\n bufferMetadata.cardinality = _cardinality;\n emit Deployed(_cardinality);\n }\n\n /* ============ External Functions ============ */\n\n /// @inheritdoc IPrizeDistributionBuffer\n function getBufferCardinality() external view override returns (uint32) {\n return bufferMetadata.cardinality;\n }\n\n /// @inheritdoc IPrizeDistributionBuffer\n function getPrizeDistribution(uint32 _drawId)\n external\n view\n override\n returns (IPrizeDistributionBuffer.PrizeDistribution memory)\n {\n return _getPrizeDistribution(bufferMetadata, _drawId);\n }\n\n /// @inheritdoc IPrizeDistributionSource\n function getPrizeDistributions(uint32[] calldata _drawIds)\n external\n view\n override\n returns (IPrizeDistributionBuffer.PrizeDistribution[] memory)\n {\n uint256 drawIdsLength = _drawIds.length;\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\n IPrizeDistributionBuffer.PrizeDistribution[]\n memory _prizeDistributions = new IPrizeDistributionBuffer.PrizeDistribution[](\n drawIdsLength\n );\n\n for (uint256 i = 0; i < drawIdsLength; i++) {\n _prizeDistributions[i] = _getPrizeDistribution(buffer, _drawIds[i]);\n }\n\n return _prizeDistributions;\n }\n\n /// @inheritdoc IPrizeDistributionBuffer\n function getPrizeDistributionCount() external view override returns (uint32) {\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\n\n if (buffer.lastDrawId == 0) {\n return 0;\n }\n\n uint32 bufferNextIndex = buffer.nextIndex;\n\n // If the buffer is full return the cardinality, else retun the nextIndex\n if (prizeDistributionRingBuffer[bufferNextIndex].matchCardinality != 0) {\n return buffer.cardinality;\n } else {\n return bufferNextIndex;\n }\n }\n\n /// @inheritdoc IPrizeDistributionBuffer\n function getNewestPrizeDistribution()\n external\n view\n override\n returns (IPrizeDistributionBuffer.PrizeDistribution memory prizeDistribution, uint32 drawId)\n {\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\n\n return (prizeDistributionRingBuffer[buffer.getIndex(buffer.lastDrawId)], buffer.lastDrawId);\n }\n\n /// @inheritdoc IPrizeDistributionBuffer\n function getOldestPrizeDistribution()\n external\n view\n override\n returns (IPrizeDistributionBuffer.PrizeDistribution memory prizeDistribution, uint32 drawId)\n {\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\n\n // if the ring buffer is full, the oldest is at the nextIndex\n prizeDistribution = prizeDistributionRingBuffer[buffer.nextIndex];\n\n // The PrizeDistribution at index 0 IS by default the oldest prizeDistribution.\n if (buffer.lastDrawId == 0) {\n drawId = 0; // return 0 to indicate no prizeDistribution ring buffer history\n } else if (prizeDistribution.bitRangeSize == 0) {\n // IF the next PrizeDistribution.bitRangeSize == 0 the ring buffer HAS NOT looped around so the oldest is the first entry.\n prizeDistribution = prizeDistributionRingBuffer[0];\n drawId = (buffer.lastDrawId + 1) - buffer.nextIndex;\n } else {\n // Calculates the drawId using the ring buffer cardinality\n // Sequential drawIds are gauranteed by DrawRingBufferLib.push()\n drawId = (buffer.lastDrawId + 1) - buffer.cardinality;\n }\n }\n\n /// @inheritdoc IPrizeDistributionBuffer\n function pushPrizeDistribution(\n uint32 _drawId,\n IPrizeDistributionBuffer.PrizeDistribution calldata _prizeDistribution\n ) external override onlyManagerOrOwner returns (bool) {\n return _pushPrizeDistribution(_drawId, _prizeDistribution);\n }\n\n /// @inheritdoc IPrizeDistributionBuffer\n function setPrizeDistribution(\n uint32 _drawId,\n IPrizeDistributionBuffer.PrizeDistribution calldata _prizeDistribution\n ) external override onlyOwner returns (uint32) {\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\n uint32 index = buffer.getIndex(_drawId);\n prizeDistributionRingBuffer[index] = _prizeDistribution;\n\n emit PrizeDistributionSet(_drawId, _prizeDistribution);\n\n return _drawId;\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Gets the PrizeDistributionBuffer for a drawId\n * @param _buffer DrawRingBufferLib.Buffer\n * @param _drawId drawId\n */\n function _getPrizeDistribution(DrawRingBufferLib.Buffer memory _buffer, uint32 _drawId)\n internal\n view\n returns (IPrizeDistributionBuffer.PrizeDistribution memory)\n {\n return prizeDistributionRingBuffer[_buffer.getIndex(_drawId)];\n }\n\n /**\n * @notice Set newest PrizeDistributionBuffer in ring buffer storage.\n * @param _drawId drawId\n * @param _prizeDistribution PrizeDistributionBuffer struct\n */\n function _pushPrizeDistribution(\n uint32 _drawId,\n IPrizeDistributionBuffer.PrizeDistribution calldata _prizeDistribution\n ) internal returns (bool) {\n require(_drawId > 0, \"DrawCalc/draw-id-gt-0\");\n require(_prizeDistribution.matchCardinality > 0, \"DrawCalc/matchCardinality-gt-0\");\n require(\n _prizeDistribution.bitRangeSize <= 256 / _prizeDistribution.matchCardinality,\n \"DrawCalc/bitRangeSize-too-large\"\n );\n\n require(_prizeDistribution.bitRangeSize > 0, \"DrawCalc/bitRangeSize-gt-0\");\n require(_prizeDistribution.maxPicksPerUser > 0, \"DrawCalc/maxPicksPerUser-gt-0\");\n require(_prizeDistribution.expiryDuration > 0, \"DrawCalc/expiryDuration-gt-0\");\n\n // ensure that the sum of the tiers are not gt 100%\n uint256 sumTotalTiers = 0;\n uint256 tiersLength = _prizeDistribution.tiers.length;\n\n for (uint256 index = 0; index < tiersLength; index++) {\n uint256 tier = _prizeDistribution.tiers[index];\n sumTotalTiers += tier;\n }\n\n // Each tier amount stored as uint32 - summed can't exceed 1e9\n require(sumTotalTiers <= TIERS_CEILING, \"DrawCalc/tiers-gt-100%\");\n\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\n\n // store the PrizeDistribution in the ring buffer\n prizeDistributionRingBuffer[buffer.nextIndex] = _prizeDistribution;\n\n // update the ring buffer data\n bufferMetadata = buffer.push(_drawId);\n\n emit PrizeDistributionSet(_drawId, _prizeDistribution);\n\n return true;\n }\n}\n" + }, + "@pooltogether/v4-core/contracts/PrizeDistributor.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@pooltogether/owner-manager-contracts/contracts/Ownable.sol\";\n\nimport \"./interfaces/IPrizeDistributor.sol\";\nimport \"./interfaces/IDrawCalculator.sol\";\n\n/**\n * @title PoolTogether V4 PrizeDistributor\n * @author PoolTogether Inc Team\n * @notice The PrizeDistributor contract holds Tickets (captured interest) and distributes tickets to users with winning draw claims.\n PrizeDistributor uses an external IDrawCalculator to validate a users draw claim, before awarding payouts. To prevent users \n from reclaiming prizes, a payout history for each draw claim is mapped to user accounts. Reclaiming a draw can occur\n if an \"optimal\" prize was not included in previous claim pick indices and the new claims updated payout is greater then\n the previous prize distributor claim payout.\n*/\ncontract PrizeDistributor is IPrizeDistributor, Ownable {\n using SafeERC20 for IERC20;\n\n /* ============ Global Variables ============ */\n\n /// @notice DrawCalculator address\n IDrawCalculator internal drawCalculator;\n\n /// @notice Token address\n IERC20 internal immutable token;\n\n /// @notice Maps users => drawId => paid out balance\n mapping(address => mapping(uint256 => uint256)) internal userDrawPayouts;\n\n /* ============ Initialize ============ */\n\n /**\n * @notice Initialize PrizeDistributor smart contract.\n * @param _owner Owner address\n * @param _token Token address\n * @param _drawCalculator DrawCalculator address\n */\n constructor(\n address _owner,\n IERC20 _token,\n IDrawCalculator _drawCalculator\n ) Ownable(_owner) {\n _setDrawCalculator(_drawCalculator);\n require(address(_token) != address(0), \"PrizeDistributor/token-not-zero-address\");\n token = _token;\n emit TokenSet(_token);\n }\n\n /* ============ External Functions ============ */\n\n /// @inheritdoc IPrizeDistributor\n function claim(\n address _user,\n uint32[] calldata _drawIds,\n bytes calldata _data\n ) external override returns (uint256) {\n \n uint256 totalPayout;\n \n (uint256[] memory drawPayouts, ) = drawCalculator.calculate(_user, _drawIds, _data); // neglect the prizeCounts since we are not interested in them here\n\n uint256 drawPayoutsLength = drawPayouts.length;\n for (uint256 payoutIndex = 0; payoutIndex < drawPayoutsLength; payoutIndex++) {\n uint32 drawId = _drawIds[payoutIndex];\n uint256 payout = drawPayouts[payoutIndex];\n uint256 oldPayout = _getDrawPayoutBalanceOf(_user, drawId);\n uint256 payoutDiff = 0;\n\n // helpfully short-circuit, in case the user screwed something up.\n require(payout > oldPayout, \"PrizeDistributor/zero-payout\");\n\n unchecked {\n payoutDiff = payout - oldPayout;\n }\n\n _setDrawPayoutBalanceOf(_user, drawId, payout);\n\n totalPayout += payoutDiff;\n\n emit ClaimedDraw(_user, drawId, payoutDiff);\n }\n\n _awardPayout(_user, totalPayout);\n\n return totalPayout;\n }\n\n /// @inheritdoc IPrizeDistributor\n function withdrawERC20(\n IERC20 _erc20Token,\n address _to,\n uint256 _amount\n ) external override onlyOwner returns (bool) {\n require(_to != address(0), \"PrizeDistributor/recipient-not-zero-address\");\n require(address(_erc20Token) != address(0), \"PrizeDistributor/ERC20-not-zero-address\");\n\n _erc20Token.safeTransfer(_to, _amount);\n\n emit ERC20Withdrawn(_erc20Token, _to, _amount);\n\n return true;\n }\n\n /// @inheritdoc IPrizeDistributor\n function getDrawCalculator() external view override returns (IDrawCalculator) {\n return drawCalculator;\n }\n\n /// @inheritdoc IPrizeDistributor\n function getDrawPayoutBalanceOf(address _user, uint32 _drawId)\n external\n view\n override\n returns (uint256)\n {\n return _getDrawPayoutBalanceOf(_user, _drawId);\n }\n\n /// @inheritdoc IPrizeDistributor\n function getToken() external view override returns (IERC20) {\n return token;\n }\n\n /// @inheritdoc IPrizeDistributor\n function setDrawCalculator(IDrawCalculator _newCalculator)\n external\n override\n onlyOwner\n returns (IDrawCalculator)\n {\n _setDrawCalculator(_newCalculator);\n return _newCalculator;\n }\n\n /* ============ Internal Functions ============ */\n\n function _getDrawPayoutBalanceOf(address _user, uint32 _drawId)\n internal\n view\n returns (uint256)\n {\n return userDrawPayouts[_user][_drawId];\n }\n\n function _setDrawPayoutBalanceOf(\n address _user,\n uint32 _drawId,\n uint256 _payout\n ) internal {\n userDrawPayouts[_user][_drawId] = _payout;\n }\n\n /**\n * @notice Sets DrawCalculator reference for individual draw id.\n * @param _newCalculator DrawCalculator address\n */\n function _setDrawCalculator(IDrawCalculator _newCalculator) internal {\n require(address(_newCalculator) != address(0), \"PrizeDistributor/calc-not-zero\");\n drawCalculator = _newCalculator;\n\n emit DrawCalculatorSet(_newCalculator);\n }\n\n /**\n * @notice Transfer claimed draw(s) total payout to user.\n * @param _to User address\n * @param _amount Transfer amount\n */\n function _awardPayout(address _to, uint256 _amount) internal {\n token.safeTransfer(_to, _amount);\n }\n\n}\n" + }, + "@pooltogether/v4-core/contracts/libraries/TwabLib.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"./ExtendedSafeCastLib.sol\";\nimport \"./OverflowSafeComparatorLib.sol\";\nimport \"./RingBufferLib.sol\";\nimport \"./ObservationLib.sol\";\n\n/**\n * @title PoolTogether V4 TwabLib (Library)\n * @author PoolTogether Inc Team\n * @dev Time-Weighted Average Balance Library for ERC20 tokens.\n * @notice This TwabLib adds on-chain historical lookups to a user(s) time-weighted average balance.\n Each user is mapped to an Account struct containing the TWAB history (ring bufffer) and\n ring buffer parameters. Every token.transfer() creates a new TWAB checkpoint. The new TWAB\n checkpoint is stored in the circular ring buffer, as either a new checkpoint or rewriting\n a previous checkpoint with new parameters. The TwabLib (using existing blocktimes 1block/15sec)\n guarantees minimum 7.4 years of search history.\n */\nlibrary TwabLib {\n using OverflowSafeComparatorLib for uint32;\n using ExtendedSafeCastLib for uint256;\n\n /**\n * @notice Sets max ring buffer length in the Account.twabs Observation list.\n As users transfer/mint/burn tickets new Observation checkpoints are\n recorded. The current max cardinality guarantees a six month minimum,\n of historical accurate lookups with current estimates of 1 new block\n every 15 seconds - the of course contain a transfer to trigger an\n observation write to storage.\n * @dev The user Account.AccountDetails.cardinality parameter can NOT exceed\n the max cardinality variable. Preventing \"corrupted\" ring buffer lookup\n pointers and new observation checkpoints.\n\n The MAX_CARDINALITY in fact guarantees at least 7.4 years of records:\n If 14 = block time in seconds\n (2**24) * 14 = 234881024 seconds of history\n 234881024 / (365 * 24 * 60 * 60) ~= 7.44 years\n */\n uint24 public constant MAX_CARDINALITY = 16777215; // 2**24\n\n /** @notice Struct ring buffer parameters for single user Account\n * @param balance Current balance for an Account\n * @param nextTwabIndex Next uninitialized or updatable ring buffer checkpoint storage slot\n * @param cardinality Current total \"initialized\" ring buffer checkpoints for single user AccountDetails.\n Used to set initial boundary conditions for an efficient binary search.\n */\n struct AccountDetails {\n uint208 balance;\n uint24 nextTwabIndex;\n uint24 cardinality;\n }\n\n /// @notice Combines account details with their twab history\n /// @param details The account details\n /// @param twabs The history of twabs for this account\n struct Account {\n AccountDetails details;\n ObservationLib.Observation[MAX_CARDINALITY] twabs;\n }\n\n /// @notice Increases an account's balance and records a new twab.\n /// @param _account The account whose balance will be increased\n /// @param _amount The amount to increase the balance by\n /// @param _currentTime The current time\n /// @return accountDetails The new AccountDetails\n /// @return twab The user's latest TWAB\n /// @return isNew Whether the TWAB is new\n function increaseBalance(\n Account storage _account,\n uint208 _amount,\n uint32 _currentTime\n )\n internal\n returns (\n AccountDetails memory accountDetails,\n ObservationLib.Observation memory twab,\n bool isNew\n )\n {\n AccountDetails memory _accountDetails = _account.details;\n (accountDetails, twab, isNew) = _nextTwab(_account.twabs, _accountDetails, _currentTime);\n accountDetails.balance = _accountDetails.balance + _amount;\n }\n\n /** @notice Calculates the next TWAB checkpoint for an account with a decreasing balance.\n * @dev With Account struct and amount decreasing calculates the next TWAB observable checkpoint.\n * @param _account Account whose balance will be decreased\n * @param _amount Amount to decrease the balance by\n * @param _revertMessage Revert message for insufficient balance\n * @return accountDetails Updated Account.details struct\n * @return twab TWAB observation (with decreasing average)\n * @return isNew Whether TWAB is new or calling twice in the same block\n */\n function decreaseBalance(\n Account storage _account,\n uint208 _amount,\n string memory _revertMessage,\n uint32 _currentTime\n )\n internal\n returns (\n AccountDetails memory accountDetails,\n ObservationLib.Observation memory twab,\n bool isNew\n )\n {\n AccountDetails memory _accountDetails = _account.details;\n\n require(_accountDetails.balance >= _amount, _revertMessage);\n\n (accountDetails, twab, isNew) = _nextTwab(_account.twabs, _accountDetails, _currentTime);\n unchecked {\n accountDetails.balance -= _amount;\n }\n }\n\n /** @notice Calculates the average balance held by a user for a given time frame.\n * @dev Finds the average balance between start and end timestamp epochs.\n Validates the supplied end time is within the range of elapsed time i.e. less then timestamp of now.\n * @param _twabs Individual user Observation recorded checkpoints passed as storage pointer\n * @param _accountDetails User AccountDetails struct loaded in memory\n * @param _startTime Start of timestamp range as an epoch\n * @param _endTime End of timestamp range as an epoch\n * @param _currentTime Block.timestamp\n * @return Average balance of user held between epoch timestamps start and end\n */\n function getAverageBalanceBetween(\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\n AccountDetails memory _accountDetails,\n uint32 _startTime,\n uint32 _endTime,\n uint32 _currentTime\n ) internal view returns (uint256) {\n uint32 endTime = _endTime > _currentTime ? _currentTime : _endTime;\n\n return\n _getAverageBalanceBetween(_twabs, _accountDetails, _startTime, endTime, _currentTime);\n }\n\n /// @notice Retrieves the oldest TWAB\n /// @param _twabs The storage array of twabs\n /// @param _accountDetails The TWAB account details\n /// @return index The index of the oldest TWAB in the twabs array\n /// @return twab The oldest TWAB\n function oldestTwab(\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\n AccountDetails memory _accountDetails\n ) internal view returns (uint24 index, ObservationLib.Observation memory twab) {\n index = _accountDetails.nextTwabIndex;\n twab = _twabs[index];\n\n // If the TWAB is not initialized we go to the beginning of the TWAB circular buffer at index 0\n if (twab.timestamp == 0) {\n index = 0;\n twab = _twabs[0];\n }\n }\n\n /// @notice Retrieves the newest TWAB\n /// @param _twabs The storage array of twabs\n /// @param _accountDetails The TWAB account details\n /// @return index The index of the newest TWAB in the twabs array\n /// @return twab The newest TWAB\n function newestTwab(\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\n AccountDetails memory _accountDetails\n ) internal view returns (uint24 index, ObservationLib.Observation memory twab) {\n index = uint24(RingBufferLib.newestIndex(_accountDetails.nextTwabIndex, MAX_CARDINALITY));\n twab = _twabs[index];\n }\n\n /// @notice Retrieves amount at `_targetTime` timestamp\n /// @param _twabs List of TWABs to search through.\n /// @param _accountDetails Accounts details\n /// @param _targetTime Timestamp at which the reserved TWAB should be for.\n /// @return uint256 TWAB amount at `_targetTime`.\n function getBalanceAt(\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\n AccountDetails memory _accountDetails,\n uint32 _targetTime,\n uint32 _currentTime\n ) internal view returns (uint256) {\n uint32 timeToTarget = _targetTime > _currentTime ? _currentTime : _targetTime;\n return _getBalanceAt(_twabs, _accountDetails, timeToTarget, _currentTime);\n }\n\n /// @notice Calculates the average balance held by a user for a given time frame.\n /// @param _startTime The start time of the time frame.\n /// @param _endTime The end time of the time frame.\n /// @return The average balance that the user held during the time frame.\n function _getAverageBalanceBetween(\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\n AccountDetails memory _accountDetails,\n uint32 _startTime,\n uint32 _endTime,\n uint32 _currentTime\n ) private view returns (uint256) {\n (uint24 oldestTwabIndex, ObservationLib.Observation memory oldTwab) = oldestTwab(\n _twabs,\n _accountDetails\n );\n\n (uint24 newestTwabIndex, ObservationLib.Observation memory newTwab) = newestTwab(\n _twabs,\n _accountDetails\n );\n\n ObservationLib.Observation memory startTwab = _calculateTwab(\n _twabs,\n _accountDetails,\n newTwab,\n oldTwab,\n newestTwabIndex,\n oldestTwabIndex,\n _startTime,\n _currentTime\n );\n\n ObservationLib.Observation memory endTwab = _calculateTwab(\n _twabs,\n _accountDetails,\n newTwab,\n oldTwab,\n newestTwabIndex,\n oldestTwabIndex,\n _endTime,\n _currentTime\n );\n\n // Difference in amount / time\n return (endTwab.amount - startTwab.amount) / OverflowSafeComparatorLib.checkedSub(endTwab.timestamp, startTwab.timestamp, _currentTime);\n }\n\n /** @notice Searches TWAB history and calculate the difference between amount(s)/timestamp(s) to return average balance\n between the Observations closes to the supplied targetTime.\n * @param _twabs Individual user Observation recorded checkpoints passed as storage pointer\n * @param _accountDetails User AccountDetails struct loaded in memory\n * @param _targetTime Target timestamp to filter Observations in the ring buffer binary search\n * @param _currentTime Block.timestamp\n * @return uint256 Time-weighted average amount between two closest observations.\n */\n function _getBalanceAt(\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\n AccountDetails memory _accountDetails,\n uint32 _targetTime,\n uint32 _currentTime\n ) private view returns (uint256) {\n uint24 newestTwabIndex;\n ObservationLib.Observation memory afterOrAt;\n ObservationLib.Observation memory beforeOrAt;\n (newestTwabIndex, beforeOrAt) = newestTwab(_twabs, _accountDetails);\n\n // If `_targetTime` is chronologically after the newest TWAB, we can simply return the current balance\n if (beforeOrAt.timestamp.lte(_targetTime, _currentTime)) {\n return _accountDetails.balance;\n }\n\n uint24 oldestTwabIndex;\n // Now, set before to the oldest TWAB\n (oldestTwabIndex, beforeOrAt) = oldestTwab(_twabs, _accountDetails);\n\n // If `_targetTime` is chronologically before the oldest TWAB, we can early return\n if (_targetTime.lt(beforeOrAt.timestamp, _currentTime)) {\n return 0;\n }\n\n // Otherwise, we perform the `binarySearch`\n (beforeOrAt, afterOrAt) = ObservationLib.binarySearch(\n _twabs,\n newestTwabIndex,\n oldestTwabIndex,\n _targetTime,\n _accountDetails.cardinality,\n _currentTime\n );\n\n // Sum the difference in amounts and divide by the difference in timestamps.\n // The time-weighted average balance uses time measured between two epoch timestamps as\n // a constaint on the measurement when calculating the time weighted average balance.\n return\n (afterOrAt.amount - beforeOrAt.amount) / OverflowSafeComparatorLib.checkedSub(afterOrAt.timestamp, beforeOrAt.timestamp, _currentTime);\n }\n\n /** @notice Calculates a user TWAB for a target timestamp using the historical TWAB records.\n The balance is linearly interpolated: amount differences / timestamp differences\n using the simple (after.amount - before.amount / end.timestamp - start.timestamp) formula.\n /** @dev Binary search in _calculateTwab fails when searching out of bounds. Thus, before\n searching we exclude target timestamps out of range of newest/oldest TWAB(s).\n IF a search is before or after the range we \"extrapolate\" a Observation from the expected state.\n * @param _twabs Individual user Observation recorded checkpoints passed as storage pointer\n * @param _accountDetails User AccountDetails struct loaded in memory\n * @param _newestTwab Newest TWAB in history (end of ring buffer)\n * @param _oldestTwab Olderst TWAB in history (end of ring buffer)\n * @param _newestTwabIndex Pointer in ring buffer to newest TWAB\n * @param _oldestTwabIndex Pointer in ring buffer to oldest TWAB\n * @param _targetTimestamp Epoch timestamp to calculate for time (T) in the TWAB\n * @param _time Block.timestamp\n * @return accountDetails Updated Account.details struct\n */\n function _calculateTwab(\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\n AccountDetails memory _accountDetails,\n ObservationLib.Observation memory _newestTwab,\n ObservationLib.Observation memory _oldestTwab,\n uint24 _newestTwabIndex,\n uint24 _oldestTwabIndex,\n uint32 _targetTimestamp,\n uint32 _time\n ) private view returns (ObservationLib.Observation memory) {\n // If `_targetTimestamp` is chronologically after the newest TWAB, we extrapolate a new one\n if (_newestTwab.timestamp.lt(_targetTimestamp, _time)) {\n return _computeNextTwab(_newestTwab, _accountDetails.balance, _targetTimestamp);\n }\n\n if (_newestTwab.timestamp == _targetTimestamp) {\n return _newestTwab;\n }\n\n if (_oldestTwab.timestamp == _targetTimestamp) {\n return _oldestTwab;\n }\n\n // If `_targetTimestamp` is chronologically before the oldest TWAB, we create a zero twab\n if (_targetTimestamp.lt(_oldestTwab.timestamp, _time)) {\n return ObservationLib.Observation({ amount: 0, timestamp: _targetTimestamp });\n }\n\n // Otherwise, both timestamps must be surrounded by twabs.\n (\n ObservationLib.Observation memory beforeOrAtStart,\n ObservationLib.Observation memory afterOrAtStart\n ) = ObservationLib.binarySearch(\n _twabs,\n _newestTwabIndex,\n _oldestTwabIndex,\n _targetTimestamp,\n _accountDetails.cardinality,\n _time\n );\n\n uint224 heldBalance = (afterOrAtStart.amount - beforeOrAtStart.amount) /\n OverflowSafeComparatorLib.checkedSub(afterOrAtStart.timestamp, beforeOrAtStart.timestamp, _time);\n\n return _computeNextTwab(beforeOrAtStart, heldBalance, _targetTimestamp);\n }\n\n /**\n * @notice Calculates the next TWAB using the newestTwab and updated balance.\n * @dev Storage of the TWAB obersation is managed by the calling function and not _computeNextTwab.\n * @param _currentTwab Newest Observation in the Account.twabs list\n * @param _currentBalance User balance at time of most recent (newest) checkpoint write\n * @param _time Current block.timestamp\n * @return TWAB Observation\n */\n function _computeNextTwab(\n ObservationLib.Observation memory _currentTwab,\n uint224 _currentBalance,\n uint32 _time\n ) private pure returns (ObservationLib.Observation memory) {\n // New twab amount = last twab amount (or zero) + (current amount * elapsed seconds)\n return\n ObservationLib.Observation({\n amount: _currentTwab.amount +\n _currentBalance *\n (_time.checkedSub(_currentTwab.timestamp, _time)),\n timestamp: _time\n });\n }\n\n /// @notice Sets a new TWAB Observation at the next available index and returns the new account details.\n /// @dev Note that if _currentTime is before the last observation timestamp, it appears as an overflow\n /// @param _twabs The twabs array to insert into\n /// @param _accountDetails The current account details\n /// @param _currentTime The current time\n /// @return accountDetails The new account details\n /// @return twab The newest twab (may or may not be brand-new)\n /// @return isNew Whether the newest twab was created by this call\n function _nextTwab(\n ObservationLib.Observation[MAX_CARDINALITY] storage _twabs,\n AccountDetails memory _accountDetails,\n uint32 _currentTime\n )\n private\n returns (\n AccountDetails memory accountDetails,\n ObservationLib.Observation memory twab,\n bool isNew\n )\n {\n (, ObservationLib.Observation memory _newestTwab) = newestTwab(_twabs, _accountDetails);\n\n // if we're in the same block, return\n if (_newestTwab.timestamp == _currentTime) {\n return (_accountDetails, _newestTwab, false);\n }\n\n ObservationLib.Observation memory newTwab = _computeNextTwab(\n _newestTwab,\n _accountDetails.balance,\n _currentTime\n );\n\n _twabs[_accountDetails.nextTwabIndex] = newTwab;\n\n AccountDetails memory nextAccountDetails = push(_accountDetails);\n\n return (nextAccountDetails, newTwab, true);\n }\n\n /// @notice \"Pushes\" a new element on the AccountDetails ring buffer, and returns the new AccountDetails\n /// @param _accountDetails The account details from which to pull the cardinality and next index\n /// @return The new AccountDetails\n function push(AccountDetails memory _accountDetails)\n internal\n pure\n returns (AccountDetails memory)\n {\n _accountDetails.nextTwabIndex = uint24(\n RingBufferLib.nextIndex(_accountDetails.nextTwabIndex, MAX_CARDINALITY)\n );\n\n // Prevent the Account specific cardinality from exceeding the MAX_CARDINALITY.\n // The ring buffer length is limited by MAX_CARDINALITY. IF the account.cardinality\n // exceeds the max cardinality, new observations would be incorrectly set or the\n // observation would be out of \"bounds\" of the ring buffer. Once reached the\n // AccountDetails.cardinality will continue to be equal to max cardinality.\n if (_accountDetails.cardinality < MAX_CARDINALITY) {\n _accountDetails.cardinality += 1;\n }\n\n return _accountDetails;\n }\n}\n" + }, + "@pooltogether/v4-core/contracts/interfaces/IControlledToken.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/** @title IControlledToken\n * @author PoolTogether Inc Team\n * @notice ERC20 Tokens with a controller for minting & burning.\n*/\ninterface IControlledToken is IERC20 {\n\n /** \n @notice Interface to the contract responsible for controlling mint/burn\n */\n function controller() external view returns (address);\n\n /** \n * @notice Allows the controller to mint tokens for a user account\n * @dev May be overridden to provide more granular control over minting\n * @param user Address of the receiver of the minted tokens\n * @param amount Amount of tokens to mint\n */\n function controllerMint(address user, uint256 amount) external;\n\n /** \n * @notice Allows the controller to burn tokens from a user account\n * @dev May be overridden to provide more granular control over burning\n * @param user Address of the holder account to burn tokens from\n * @param amount Amount of tokens to burn\n */\n function controllerBurn(address user, uint256 amount) external;\n\n /** \n * @notice Allows an operator via the controller to burn tokens on behalf of a user account\n * @dev May be overridden to provide more granular control over operator-burning\n * @param operator Address of the operator performing the burn action via the controller contract\n * @param user Address of the holder account to burn tokens from\n * @param amount Amount of tokens to burn\n */\n function controllerBurnFrom(\n address operator,\n address user,\n uint256 amount\n ) external;\n}\n" + }, + "@pooltogether/v4-core/contracts/libraries/ExtendedSafeCastLib.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary ExtendedSafeCastLib {\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 _value) internal pure returns (uint104) {\n require(_value <= type(uint104).max, \"SafeCast: value doesn't fit in 104 bits\");\n return uint104(_value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 _value) internal pure returns (uint208) {\n require(_value <= type(uint208).max, \"SafeCast: value doesn't fit in 208 bits\");\n return uint208(_value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 _value) internal pure returns (uint224) {\n require(_value <= type(uint224).max, \"SafeCast: value doesn't fit in 224 bits\");\n return uint224(_value);\n }\n}\n" + }, + "@pooltogether/v4-core/contracts/libraries/OverflowSafeComparatorLib.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\n/// @title OverflowSafeComparatorLib library to share comparator functions between contracts\n/// @dev Code taken from Uniswap V3 Oracle.sol: https://github.com/Uniswap/v3-core/blob/3e88af408132fc957e3e406f65a0ce2b1ca06c3d/contracts/libraries/Oracle.sol\n/// @author PoolTogether Inc.\nlibrary OverflowSafeComparatorLib {\n /// @notice 32-bit timestamps comparator.\n /// @dev safe for 0 or 1 overflows, `_a` and `_b` must be chronologically before or equal to time.\n /// @param _a A comparison timestamp from which to determine the relative position of `_timestamp`.\n /// @param _b Timestamp to compare against `_a`.\n /// @param _timestamp A timestamp truncated to 32 bits.\n /// @return bool Whether `_a` is chronologically < `_b`.\n function lt(\n uint32 _a,\n uint32 _b,\n uint32 _timestamp\n ) internal pure returns (bool) {\n // No need to adjust if there hasn't been an overflow\n if (_a <= _timestamp && _b <= _timestamp) return _a < _b;\n\n uint256 aAdjusted = _a > _timestamp ? _a : _a + 2**32;\n uint256 bAdjusted = _b > _timestamp ? _b : _b + 2**32;\n\n return aAdjusted < bAdjusted;\n }\n\n /// @notice 32-bit timestamps comparator.\n /// @dev safe for 0 or 1 overflows, `_a` and `_b` must be chronologically before or equal to time.\n /// @param _a A comparison timestamp from which to determine the relative position of `_timestamp`.\n /// @param _b Timestamp to compare against `_a`.\n /// @param _timestamp A timestamp truncated to 32 bits.\n /// @return bool Whether `_a` is chronologically <= `_b`.\n function lte(\n uint32 _a,\n uint32 _b,\n uint32 _timestamp\n ) internal pure returns (bool) {\n\n // No need to adjust if there hasn't been an overflow\n if (_a <= _timestamp && _b <= _timestamp) return _a <= _b;\n\n uint256 aAdjusted = _a > _timestamp ? _a : _a + 2**32;\n uint256 bAdjusted = _b > _timestamp ? _b : _b + 2**32;\n\n return aAdjusted <= bAdjusted;\n }\n\n /// @notice 32-bit timestamp subtractor\n /// @dev safe for 0 or 1 overflows, where `_a` and `_b` must be chronologically before or equal to time\n /// @param _a The subtraction left operand\n /// @param _b The subtraction right operand\n /// @param _timestamp The current time. Expected to be chronologically after both.\n /// @return The difference between a and b, adjusted for overflow\n function checkedSub(\n uint32 _a,\n uint32 _b,\n uint32 _timestamp\n ) internal pure returns (uint32) {\n // No need to adjust if there hasn't been an overflow\n\n if (_a <= _timestamp && _b <= _timestamp) return _a - _b;\n\n uint256 aAdjusted = _a > _timestamp ? _a : _a + 2**32;\n uint256 bAdjusted = _b > _timestamp ? _b : _b + 2**32;\n\n return uint32(aAdjusted - bAdjusted);\n }\n}\n" + }, + "@pooltogether/v4-core/contracts/libraries/RingBufferLib.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nlibrary RingBufferLib {\n /**\n * @notice Returns wrapped TWAB index.\n * @dev In order to navigate the TWAB circular buffer, we need to use the modulo operator.\n * @dev For example, if `_index` is equal to 32 and the TWAB circular buffer is of `_cardinality` 32,\n * it will return 0 and will point to the first element of the array.\n * @param _index Index used to navigate through the TWAB circular buffer.\n * @param _cardinality TWAB buffer cardinality.\n * @return TWAB index.\n */\n function wrap(uint256 _index, uint256 _cardinality) internal pure returns (uint256) {\n return _index % _cardinality;\n }\n\n /**\n * @notice Computes the negative offset from the given index, wrapped by the cardinality.\n * @dev We add `_cardinality` to `_index` to be able to offset even if `_amount` is superior to `_cardinality`.\n * @param _index The index from which to offset\n * @param _amount The number of indices to offset. This is subtracted from the given index.\n * @param _cardinality The number of elements in the ring buffer\n * @return Offsetted index.\n */\n function offset(\n uint256 _index,\n uint256 _amount,\n uint256 _cardinality\n ) internal pure returns (uint256) {\n return wrap(_index + _cardinality - _amount, _cardinality);\n }\n\n /// @notice Returns the index of the last recorded TWAB\n /// @param _nextIndex The next available twab index. This will be recorded to next.\n /// @param _cardinality The cardinality of the TWAB history.\n /// @return The index of the last recorded TWAB\n function newestIndex(uint256 _nextIndex, uint256 _cardinality)\n internal\n pure\n returns (uint256)\n {\n if (_cardinality == 0) {\n return 0;\n }\n\n return wrap(_nextIndex + _cardinality - 1, _cardinality);\n }\n\n /// @notice Computes the ring buffer index that follows the given one, wrapped by cardinality\n /// @param _index The index to increment\n /// @param _cardinality The number of elements in the Ring Buffer\n /// @return The next index relative to the given index. Will wrap around to 0 if the next index == cardinality\n function nextIndex(uint256 _index, uint256 _cardinality)\n internal\n pure\n returns (uint256)\n {\n return wrap(_index + 1, _cardinality);\n }\n}\n" + }, + "@pooltogether/v4-core/contracts/libraries/ObservationLib.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\n\nimport \"./OverflowSafeComparatorLib.sol\";\nimport \"./RingBufferLib.sol\";\n\n/**\n* @title Observation Library\n* @notice This library allows one to store an array of timestamped values and efficiently binary search them.\n* @dev Largely pulled from Uniswap V3 Oracle.sol: https://github.com/Uniswap/v3-core/blob/c05a0e2c8c08c460fb4d05cfdda30b3ad8deeaac/contracts/libraries/Oracle.sol\n* @author PoolTogether Inc.\n*/\nlibrary ObservationLib {\n using OverflowSafeComparatorLib for uint32;\n using SafeCast for uint256;\n\n /// @notice The maximum number of observations\n uint24 public constant MAX_CARDINALITY = 16777215; // 2**24\n\n /**\n * @notice Observation, which includes an amount and timestamp.\n * @param amount `amount` at `timestamp`.\n * @param timestamp Recorded `timestamp`.\n */\n struct Observation {\n uint224 amount;\n uint32 timestamp;\n }\n\n /**\n * @notice Fetches Observations `beforeOrAt` and `atOrAfter` a `_target`, eg: where [`beforeOrAt`, `atOrAfter`] is satisfied.\n * The result may be the same Observation, or adjacent Observations.\n * @dev The answer must be contained in the array used when the target is located within the stored Observation.\n * boundaries: older than the most recent Observation and younger, or the same age as, the oldest Observation.\n * @dev If `_newestObservationIndex` is less than `_oldestObservationIndex`, it means that we've wrapped around the circular buffer.\n * So the most recent observation will be at `_oldestObservationIndex + _cardinality - 1`, at the beginning of the circular buffer.\n * @param _observations List of Observations to search through.\n * @param _newestObservationIndex Index of the newest Observation. Right side of the circular buffer.\n * @param _oldestObservationIndex Index of the oldest Observation. Left side of the circular buffer.\n * @param _target Timestamp at which we are searching the Observation.\n * @param _cardinality Cardinality of the circular buffer we are searching through.\n * @param _time Timestamp at which we perform the binary search.\n * @return beforeOrAt Observation recorded before, or at, the target.\n * @return atOrAfter Observation recorded at, or after, the target.\n */\n function binarySearch(\n Observation[MAX_CARDINALITY] storage _observations,\n uint24 _newestObservationIndex,\n uint24 _oldestObservationIndex,\n uint32 _target,\n uint24 _cardinality,\n uint32 _time\n ) internal view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {\n uint256 leftSide = _oldestObservationIndex;\n uint256 rightSide = _newestObservationIndex < leftSide\n ? leftSide + _cardinality - 1\n : _newestObservationIndex;\n uint256 currentIndex;\n\n while (true) {\n // We start our search in the middle of the `leftSide` and `rightSide`.\n // After each iteration, we narrow down the search to the left or the right side while still starting our search in the middle.\n currentIndex = (leftSide + rightSide) / 2;\n\n beforeOrAt = _observations[uint24(RingBufferLib.wrap(currentIndex, _cardinality))];\n uint32 beforeOrAtTimestamp = beforeOrAt.timestamp;\n\n // We've landed on an uninitialized timestamp, keep searching higher (more recently).\n if (beforeOrAtTimestamp == 0) {\n leftSide = currentIndex + 1;\n continue;\n }\n\n atOrAfter = _observations[uint24(RingBufferLib.nextIndex(currentIndex, _cardinality))];\n\n bool targetAtOrAfter = beforeOrAtTimestamp.lte(_target, _time);\n\n // Check if we've found the corresponding Observation.\n if (targetAtOrAfter && _target.lte(atOrAfter.timestamp, _time)) {\n break;\n }\n\n // If `beforeOrAtTimestamp` is greater than `_target`, then we keep searching lower. To the left of the current index.\n if (!targetAtOrAfter) {\n rightSide = currentIndex - 1;\n } else {\n // Otherwise, we keep searching higher. To the left of the current index.\n leftSide = currentIndex + 1;\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n require(value <= type(uint224).max, \"SafeCast: value doesn't fit in 224 bits\");\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n require(value <= type(uint128).max, \"SafeCast: value doesn't fit in 128 bits\");\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n require(value <= type(uint96).max, \"SafeCast: value doesn't fit in 96 bits\");\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n require(value <= type(uint64).max, \"SafeCast: value doesn't fit in 64 bits\");\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n require(value <= type(uint32).max, \"SafeCast: value doesn't fit in 32 bits\");\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n require(value <= type(uint16).max, \"SafeCast: value doesn't fit in 16 bits\");\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits.\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n require(value <= type(uint8).max, \"SafeCast: value doesn't fit in 8 bits\");\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n *\n * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= type(int128).min && value <= type(int128).max, \"SafeCast: value doesn't fit in 128 bits\");\n return int128(value);\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n *\n * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= type(int64).min && value <= type(int64).max, \"SafeCast: value doesn't fit in 64 bits\");\n return int64(value);\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n *\n * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= type(int32).min && value <= type(int32).max, \"SafeCast: value doesn't fit in 32 bits\");\n return int32(value);\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n *\n * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= type(int16).min && value <= type(int16).max, \"SafeCast: value doesn't fit in 16 bits\");\n return int16(value);\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits.\n *\n * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= type(int8).min && value <= type(int8).max, \"SafeCast: value doesn't fit in 8 bits\");\n return int8(value);\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n require(value <= uint256(type(int256).max), \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "@pooltogether/v4-core/contracts/libraries/DrawRingBufferLib.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"./RingBufferLib.sol\";\n\n/// @title Library for creating and managing a draw ring buffer.\nlibrary DrawRingBufferLib {\n /// @notice Draw buffer struct.\n struct Buffer {\n uint32 lastDrawId;\n uint32 nextIndex;\n uint32 cardinality;\n }\n\n /// @notice Helper function to know if the draw ring buffer has been initialized.\n /// @dev since draws start at 1 and are monotonically increased, we know we are uninitialized if nextIndex = 0 and lastDrawId = 0.\n /// @param _buffer The buffer to check.\n function isInitialized(Buffer memory _buffer) internal pure returns (bool) {\n return !(_buffer.nextIndex == 0 && _buffer.lastDrawId == 0);\n }\n\n /// @notice Push a draw to the buffer.\n /// @param _buffer The buffer to push to.\n /// @param _drawId The drawID to push.\n /// @return The new buffer.\n function push(Buffer memory _buffer, uint32 _drawId) internal pure returns (Buffer memory) {\n require(!isInitialized(_buffer) || _drawId == _buffer.lastDrawId + 1, \"DRB/must-be-contig\");\n\n return\n Buffer({\n lastDrawId: _drawId,\n nextIndex: uint32(RingBufferLib.nextIndex(_buffer.nextIndex, _buffer.cardinality)),\n cardinality: _buffer.cardinality\n });\n }\n\n /// @notice Get draw ring buffer index pointer.\n /// @param _buffer The buffer to get the `nextIndex` from.\n /// @param _drawId The draw id to get the index for.\n /// @return The draw ring buffer index pointer.\n function getIndex(Buffer memory _buffer, uint32 _drawId) internal pure returns (uint32) {\n require(isInitialized(_buffer) && _drawId <= _buffer.lastDrawId, \"DRB/future-draw\");\n\n uint32 indexOffset = _buffer.lastDrawId - _drawId;\n require(indexOffset < _buffer.cardinality, \"DRB/expired-draw\");\n\n uint256 mostRecent = RingBufferLib.newestIndex(_buffer.nextIndex, _buffer.cardinality);\n\n return uint32(RingBufferLib.offset(uint32(mostRecent), indexOffset, _buffer.cardinality));\n }\n}\n" + }, + "@pooltogether/v4-core/contracts/interfaces/IPrizeDistributionBuffer.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"./IPrizeDistributionSource.sol\";\n\n/** @title IPrizeDistributionBuffer\n * @author PoolTogether Inc Team\n * @notice The PrizeDistributionBuffer interface.\n */\ninterface IPrizeDistributionBuffer is IPrizeDistributionSource {\n /**\n * @notice Emit when PrizeDistribution is set.\n * @param drawId Draw id\n * @param prizeDistribution IPrizeDistributionBuffer.PrizeDistribution\n */\n event PrizeDistributionSet(\n uint32 indexed drawId,\n IPrizeDistributionBuffer.PrizeDistribution prizeDistribution\n );\n\n /**\n * @notice Read a ring buffer cardinality\n * @return Ring buffer cardinality\n */\n function getBufferCardinality() external view returns (uint32);\n\n /**\n * @notice Read newest PrizeDistribution from prize distributions ring buffer.\n * @dev Uses nextDrawIndex to calculate the most recently added PrizeDistribution.\n * @return prizeDistribution\n * @return drawId\n */\n function getNewestPrizeDistribution()\n external\n view\n returns (\n IPrizeDistributionBuffer.PrizeDistribution memory prizeDistribution,\n uint32 drawId\n );\n\n /**\n * @notice Read oldest PrizeDistribution from prize distributions ring buffer.\n * @dev Finds the oldest Draw by buffer.nextIndex and buffer.lastDrawId\n * @return prizeDistribution\n * @return drawId\n */\n function getOldestPrizeDistribution()\n external\n view\n returns (\n IPrizeDistributionBuffer.PrizeDistribution memory prizeDistribution,\n uint32 drawId\n );\n\n /**\n * @notice Gets the PrizeDistributionBuffer for a drawId\n * @param drawId drawId\n * @return prizeDistribution\n */\n function getPrizeDistribution(uint32 drawId)\n external\n view\n returns (IPrizeDistributionBuffer.PrizeDistribution memory);\n\n /**\n * @notice Gets the number of PrizeDistributions stored in the prize distributions ring buffer.\n * @dev If no Draws have been pushed, it will return 0.\n * @dev If the ring buffer is full, it will return the cardinality.\n * @dev Otherwise, it will return the NewestPrizeDistribution index + 1.\n * @return Number of PrizeDistributions stored in the prize distributions ring buffer.\n */\n function getPrizeDistributionCount() external view returns (uint32);\n\n /**\n * @notice Adds new PrizeDistribution record to ring buffer storage.\n * @dev Only callable by the owner or manager\n * @param drawId Draw ID linked to PrizeDistribution parameters\n * @param prizeDistribution PrizeDistribution parameters struct\n */\n function pushPrizeDistribution(\n uint32 drawId,\n IPrizeDistributionBuffer.PrizeDistribution calldata prizeDistribution\n ) external returns (bool);\n\n /**\n * @notice Sets existing PrizeDistribution with new PrizeDistribution parameters in ring buffer storage.\n * @dev Retroactively updates an existing PrizeDistribution and should be thought of as a \"safety\"\n fallback. If the manager is setting invalid PrizeDistribution parameters the Owner can update\n the invalid parameters with correct parameters.\n * @return drawId\n */\n function setPrizeDistribution(\n uint32 drawId,\n IPrizeDistributionBuffer.PrizeDistribution calldata draw\n ) external returns (uint32);\n}\n" + }, + "@pooltogether/v4-core/contracts/interfaces/IPrizeDistributionSource.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\n/** @title IPrizeDistributionSource\n * @author PoolTogether Inc Team\n * @notice The PrizeDistributionSource interface.\n */\ninterface IPrizeDistributionSource {\n ///@notice PrizeDistribution struct created every draw\n ///@param bitRangeSize Decimal representation of bitRangeSize\n ///@param matchCardinality The number of numbers to consider in the 256 bit random number. Must be > 1 and < 256/bitRangeSize.\n ///@param startTimestampOffset The starting time offset in seconds from which Ticket balances are calculated.\n ///@param endTimestampOffset The end time offset in seconds from which Ticket balances are calculated.\n ///@param maxPicksPerUser Maximum number of picks a user can make in this draw\n ///@param expiryDuration Length of time in seconds the PrizeDistribution is valid for. Relative to the Draw.timestamp.\n ///@param numberOfPicks Number of picks this draw has (may vary across networks according to how much the network has contributed to the Reserve)\n ///@param tiers Array of prize tiers percentages, expressed in fraction form with base 1e9. Ordering: index0: grandPrize, index1: runnerUp, etc.\n ///@param prize Total prize amount available in this draw calculator for this draw (may vary from across networks)\n struct PrizeDistribution {\n uint8 bitRangeSize;\n uint8 matchCardinality;\n uint32 startTimestampOffset;\n uint32 endTimestampOffset;\n uint32 maxPicksPerUser;\n uint32 expiryDuration;\n uint104 numberOfPicks;\n uint32[16] tiers;\n uint256 prize;\n }\n\n /**\n * @notice Gets PrizeDistribution list from array of drawIds\n * @param drawIds drawIds to get PrizeDistribution for\n * @return prizeDistributionList\n */\n function getPrizeDistributions(uint32[] calldata drawIds)\n external\n view\n returns (PrizeDistribution[] memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n function safeTransfer(\n IERC20 token,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(\n IERC20 token,\n address from,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n uint256 newAllowance = token.allowance(address(this), spender) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) {\n // Return data is optional\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "@pooltogether/v4-core/contracts/interfaces/IPrizeDistributor.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IDrawBuffer.sol\";\nimport \"./IDrawCalculator.sol\";\n\n/** @title IPrizeDistributor\n * @author PoolTogether Inc Team\n * @notice The PrizeDistributor interface.\n*/\ninterface IPrizeDistributor {\n\n /**\n * @notice Emit when user has claimed token from the PrizeDistributor.\n * @param user User address receiving draw claim payouts\n * @param drawId Draw id that was paid out\n * @param payout Payout for draw\n */\n event ClaimedDraw(address indexed user, uint32 indexed drawId, uint256 payout);\n\n /**\n * @notice Emit when DrawCalculator is set.\n * @param calculator DrawCalculator address\n */\n event DrawCalculatorSet(IDrawCalculator indexed calculator);\n\n /**\n * @notice Emit when Token is set.\n * @param token Token address\n */\n event TokenSet(IERC20 indexed token);\n\n /**\n * @notice Emit when ERC20 tokens are withdrawn.\n * @param token ERC20 token transferred.\n * @param to Address that received funds.\n * @param amount Amount of tokens transferred.\n */\n event ERC20Withdrawn(IERC20 indexed token, address indexed to, uint256 amount);\n\n /**\n * @notice Claim prize payout(s) by submitting valud drawId(s) and winning pick indice(s). The user address\n is used as the \"seed\" phrase to generate random numbers.\n * @dev The claim function is public and any wallet may execute claim on behalf of another user.\n Prizes are always paid out to the designated user account and not the caller (msg.sender).\n Claiming prizes is not limited to a single transaction. Reclaiming can be executed\n subsequentially if an \"optimal\" prize was not included in previous claim pick indices. The\n payout difference for the new claim is calculated during the award process and transfered to user.\n * @param user Address of user to claim awards for. Does NOT need to be msg.sender\n * @param drawIds Draw IDs from global DrawBuffer reference\n * @param data The data to pass to the draw calculator\n * @return Total claim payout. May include calcuations from multiple draws.\n */\n function claim(\n address user,\n uint32[] calldata drawIds,\n bytes calldata data\n ) external returns (uint256);\n\n /**\n * @notice Read global DrawCalculator address.\n * @return IDrawCalculator\n */\n function getDrawCalculator() external view returns (IDrawCalculator);\n\n /**\n * @notice Get the amount that a user has already been paid out for a draw\n * @param user User address\n * @param drawId Draw ID\n */\n function getDrawPayoutBalanceOf(address user, uint32 drawId) external view returns (uint256);\n\n /**\n * @notice Read global Ticket address.\n * @return IERC20\n */\n function getToken() external view returns (IERC20);\n\n /**\n * @notice Sets DrawCalculator reference contract.\n * @param newCalculator DrawCalculator address\n * @return New DrawCalculator address\n */\n function setDrawCalculator(IDrawCalculator newCalculator) external returns (IDrawCalculator);\n\n /**\n * @notice Transfer ERC20 tokens out of contract to recipient address.\n * @dev Only callable by contract owner.\n * @param token ERC20 token to transfer.\n * @param to Recipient of the tokens.\n * @param amount Amount of tokens to transfer.\n * @return true if operation is successful.\n */\n function withdrawERC20(\n IERC20 token,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@pooltogether/v4-timelocks/contracts/ReceiverTimelockTrigger.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.6;\nimport \"@pooltogether/v4-core/contracts/interfaces/IDrawBeacon.sol\";\nimport \"@pooltogether/v4-core/contracts/interfaces/IDrawBuffer.sol\";\nimport \"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\";\nimport \"./interfaces/IReceiverTimelockTrigger.sol\";\nimport \"./interfaces/IPrizeDistributionFactory.sol\";\nimport \"./interfaces/IDrawCalculatorTimelock.sol\";\n\n/**\n\n * @title PoolTogether V4 ReceiverTimelockTrigger\n * @author PoolTogether Inc Team\n * @notice The ReceiverTimelockTrigger smart contract is an upgrade of the L2TimelockTimelock smart contract.\n Reducing protocol risk by eliminating off-chain computation of PrizeDistribution parameters. The timelock will\n only pass the total supply of all tickets in a \"PrizePool Network\" to the prize distribution factory contract.\n*/\ncontract ReceiverTimelockTrigger is IReceiverTimelockTrigger, Manageable {\n /* ============ Global Variables ============ */\n\n /// @notice The DrawBuffer contract address.\n IDrawBuffer public immutable drawBuffer;\n\n /// @notice Internal PrizeDistributionFactory reference.\n IPrizeDistributionFactory public immutable prizeDistributionFactory;\n\n /// @notice Timelock struct reference.\n IDrawCalculatorTimelock public immutable timelock;\n\n /* ============ Constructor ============ */\n\n /**\n * @notice Initialize ReceiverTimelockTrigger smart contract.\n * @param _owner The smart contract owner\n * @param _drawBuffer DrawBuffer address\n * @param _prizeDistributionFactory PrizeDistributionFactory address\n * @param _timelock DrawCalculatorTimelock address\n */\n constructor(\n address _owner,\n IDrawBuffer _drawBuffer,\n IPrizeDistributionFactory _prizeDistributionFactory,\n IDrawCalculatorTimelock _timelock\n ) Ownable(_owner) {\n drawBuffer = _drawBuffer;\n prizeDistributionFactory = _prizeDistributionFactory;\n timelock = _timelock;\n emit Deployed(_drawBuffer, _prizeDistributionFactory, _timelock);\n }\n\n /// @inheritdoc IReceiverTimelockTrigger\n function push(IDrawBeacon.Draw memory _draw, uint256 _totalNetworkTicketSupply)\n external\n override\n onlyManagerOrOwner\n {\n timelock.lock(_draw.drawId, _draw.timestamp + _draw.beaconPeriodSeconds);\n drawBuffer.pushDraw(_draw);\n prizeDistributionFactory.pushPrizeDistribution(_draw.drawId, _totalNetworkTicketSupply);\n emit DrawLockedPushedAndTotalNetworkTicketSupplyPushed(\n _draw.drawId,\n _draw,\n _totalNetworkTicketSupply\n );\n }\n}\n" + }, + "@pooltogether/v4-timelocks/contracts/interfaces/IBeaconTimelockTrigger.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.6;\nimport \"@pooltogether/v4-core/contracts/interfaces/IDrawBeacon.sol\";\nimport \"./IPrizeDistributionFactory.sol\";\nimport \"./IDrawCalculatorTimelock.sol\";\n\n/**\n * @title PoolTogether V4 IBeaconTimelockTrigger\n * @author PoolTogether Inc Team\n * @notice The IBeaconTimelockTrigger smart contract interface...\n */\ninterface IBeaconTimelockTrigger {\n /// @notice Emitted when the contract is deployed.\n event Deployed(\n IPrizeDistributionFactory indexed prizeDistributionFactory,\n IDrawCalculatorTimelock indexed timelock\n );\n\n /**\n * @notice Emitted when Draw is locked and totalNetworkTicketSupply is pushed to PrizeDistributionFactory\n * @param drawId Draw ID\n * @param draw Draw\n * @param totalNetworkTicketSupply totalNetworkTicketSupply\n */\n event DrawLockedAndTotalNetworkTicketSupplyPushed(\n uint32 indexed drawId,\n IDrawBeacon.Draw draw,\n uint256 totalNetworkTicketSupply\n );\n\n /**\n * @notice Locks next Draw and pushes totalNetworkTicketSupply to PrizeDistributionFactory\n * @dev Restricts new draws for N seconds by forcing timelock on the next target draw id.\n * @param draw Draw\n * @param totalNetworkTicketSupply totalNetworkTicketSupply\n */\n function push(IDrawBeacon.Draw memory draw, uint256 totalNetworkTicketSupply) external;\n}\n" + }, + "@pooltogether/v4-timelocks/contracts/BeaconTimelockTrigger.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.6;\nimport \"@pooltogether/v4-core/contracts/interfaces/IDrawBeacon.sol\";\nimport \"@pooltogether/v4-core/contracts/interfaces/IDrawBuffer.sol\";\nimport \"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\";\nimport \"./interfaces/IBeaconTimelockTrigger.sol\";\nimport \"./interfaces/IPrizeDistributionFactory.sol\";\nimport \"./interfaces/IDrawCalculatorTimelock.sol\";\n\n/**\n * @title PoolTogether V4 BeaconTimelockTrigger\n * @author PoolTogether Inc Team\n * @notice The BeaconTimelockTrigger smart contract is an upgrade of the L1TimelockTimelock smart contract.\n Reducing protocol risk by eliminating off-chain computation of PrizeDistribution parameters. The timelock will\n only pass the total supply of all tickets in a \"PrizePool Network\" to the prize distribution factory contract.\n*/\ncontract BeaconTimelockTrigger is IBeaconTimelockTrigger, Manageable {\n /* ============ Global Variables ============ */\n\n /// @notice PrizeDistributionFactory reference.\n IPrizeDistributionFactory public immutable prizeDistributionFactory;\n\n /// @notice DrawCalculatorTimelock reference.\n IDrawCalculatorTimelock public immutable timelock;\n\n /* ============ Constructor ============ */\n\n /**\n * @notice Initialize BeaconTimelockTrigger smart contract.\n * @param _owner The smart contract owner\n * @param _prizeDistributionFactory PrizeDistributionFactory address\n * @param _timelock DrawCalculatorTimelock address\n */\n constructor(\n address _owner,\n IPrizeDistributionFactory _prizeDistributionFactory,\n IDrawCalculatorTimelock _timelock\n ) Ownable(_owner) {\n prizeDistributionFactory = _prizeDistributionFactory;\n timelock = _timelock;\n emit Deployed(_prizeDistributionFactory, _timelock);\n }\n\n /// @inheritdoc IBeaconTimelockTrigger\n function push(IDrawBeacon.Draw memory _draw, uint256 _totalNetworkTicketSupply)\n external\n override\n onlyManagerOrOwner\n {\n timelock.lock(_draw.drawId, _draw.timestamp + _draw.beaconPeriodSeconds);\n prizeDistributionFactory.pushPrizeDistribution(_draw.drawId, _totalNetworkTicketSupply);\n emit DrawLockedAndTotalNetworkTicketSupplyPushed(\n _draw.drawId,\n _draw,\n _totalNetworkTicketSupply\n );\n }\n}\n" + }, + "@pooltogether/v4-timelocks/contracts/L2TimelockTrigger.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.6;\nimport \"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\";\nimport \"@pooltogether/v4-core/contracts/interfaces/IDrawBeacon.sol\";\nimport \"@pooltogether/v4-core/contracts/interfaces/IPrizeDistributionBuffer.sol\";\nimport \"@pooltogether/v4-core/contracts/interfaces/IDrawBuffer.sol\";\nimport \"./interfaces/IDrawCalculatorTimelock.sol\";\n\n/**\n * @title PoolTogether V4 L2TimelockTrigger\n * @author PoolTogether Inc Team\n * @notice L2TimelockTrigger(s) acts as an intermediary between multiple V4 smart contracts.\n The L2TimelockTrigger is responsible for pushing Draws to a DrawBuffer and routing\n claim requests from a PrizeDistributor to a DrawCalculator. The primary objective is\n to include a \"cooldown\" period for all new Draws. Allowing the correction of a\n malicously set Draw in the unfortunate event an Owner is compromised.\n*/\ncontract L2TimelockTrigger is Manageable {\n /// @notice Emitted when the contract is deployed.\n event Deployed(\n IDrawBuffer indexed drawBuffer,\n IPrizeDistributionBuffer indexed prizeDistributionBuffer,\n IDrawCalculatorTimelock indexed timelock\n );\n\n /**\n * @notice Emitted when Draw and PrizeDistribution are pushed to external contracts.\n * @param drawId Draw ID\n * @param prizeDistribution PrizeDistribution\n */\n event DrawAndPrizeDistributionPushed(\n uint32 indexed drawId,\n IDrawBeacon.Draw draw,\n IPrizeDistributionBuffer.PrizeDistribution prizeDistribution\n );\n\n /* ============ Global Variables ============ */\n\n /// @notice The DrawBuffer contract address.\n IDrawBuffer public immutable drawBuffer;\n\n /// @notice Internal PrizeDistributionBuffer reference.\n IPrizeDistributionBuffer public immutable prizeDistributionBuffer;\n\n /// @notice Timelock struct reference.\n IDrawCalculatorTimelock public timelock;\n\n /* ============ Deploy ============ */\n\n /**\n * @notice Initialize L2TimelockTrigger smart contract.\n * @param _owner Address of the L2TimelockTrigger owner.\n * @param _prizeDistributionBuffer PrizeDistributionBuffer address\n * @param _drawBuffer DrawBuffer address\n * @param _timelock Elapsed seconds before timelocked Draw is available\n */\n constructor(\n address _owner,\n IDrawBuffer _drawBuffer,\n IPrizeDistributionBuffer _prizeDistributionBuffer,\n IDrawCalculatorTimelock _timelock\n ) Ownable(_owner) {\n drawBuffer = _drawBuffer;\n prizeDistributionBuffer = _prizeDistributionBuffer;\n timelock = _timelock;\n\n emit Deployed(_drawBuffer, _prizeDistributionBuffer, _timelock);\n }\n\n /* ============ External Functions ============ */\n\n /**\n * @notice Push Draw onto draws ring buffer history.\n * @dev Restricts new draws by forcing a push timelock.\n * @param _draw Draw struct from IDrawBeacon\n * @param _prizeDistribution PrizeDistribution struct from IPrizeDistributionBuffer\n */\n function push(\n IDrawBeacon.Draw memory _draw,\n IPrizeDistributionBuffer.PrizeDistribution memory _prizeDistribution\n ) external onlyManagerOrOwner {\n timelock.lock(_draw.drawId, _draw.timestamp + _draw.beaconPeriodSeconds);\n drawBuffer.pushDraw(_draw);\n prizeDistributionBuffer.pushPrizeDistribution(_draw.drawId, _prizeDistribution);\n emit DrawAndPrizeDistributionPushed(_draw.drawId, _draw, _prizeDistribution);\n }\n}\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-core/contracts/PrizeDistributor.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-core/contracts/PrizeDistributor.sol';\n" + }, + "@pooltogether/v4-core/contracts/prize-strategy/PrizeSplit.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@pooltogether/owner-manager-contracts/contracts/Ownable.sol\";\n\nimport \"../interfaces/IPrizeSplit.sol\";\n\n/**\n * @title PrizeSplit Interface\n * @author PoolTogether Inc Team\n */\nabstract contract PrizeSplit is IPrizeSplit, Ownable {\n /* ============ Global Variables ============ */\n PrizeSplitConfig[] internal _prizeSplits;\n\n uint16 public constant ONE_AS_FIXED_POINT_3 = 1000;\n\n /* ============ External Functions ============ */\n\n /// @inheritdoc IPrizeSplit\n function getPrizeSplit(uint256 _prizeSplitIndex)\n external\n view\n override\n returns (PrizeSplitConfig memory)\n {\n return _prizeSplits[_prizeSplitIndex];\n }\n\n /// @inheritdoc IPrizeSplit\n function getPrizeSplits() external view override returns (PrizeSplitConfig[] memory) {\n return _prizeSplits;\n }\n\n /// @inheritdoc IPrizeSplit\n function setPrizeSplits(PrizeSplitConfig[] calldata _newPrizeSplits)\n external\n override\n onlyOwner\n {\n uint256 newPrizeSplitsLength = _newPrizeSplits.length;\n require(newPrizeSplitsLength <= type(uint8).max, \"PrizeSplit/invalid-prizesplits-length\");\n\n // Add and/or update prize split configs using _newPrizeSplits PrizeSplitConfig structs array.\n for (uint256 index = 0; index < newPrizeSplitsLength; index++) {\n PrizeSplitConfig memory split = _newPrizeSplits[index];\n\n // REVERT when setting the canonical burn address.\n require(split.target != address(0), \"PrizeSplit/invalid-prizesplit-target\");\n\n // IF the CURRENT prizeSplits length is below the NEW prizeSplits\n // PUSH the PrizeSplit struct to end of the list.\n if (_prizeSplits.length <= index) {\n _prizeSplits.push(split);\n } else {\n // ELSE update an existing PrizeSplit struct with new parameters\n PrizeSplitConfig memory currentSplit = _prizeSplits[index];\n\n // IF new PrizeSplit DOES NOT match the current PrizeSplit\n // WRITE to STORAGE with the new PrizeSplit\n if (\n split.target != currentSplit.target ||\n split.percentage != currentSplit.percentage\n ) {\n _prizeSplits[index] = split;\n } else {\n continue;\n }\n }\n\n // Emit the added/updated prize split config.\n emit PrizeSplitSet(split.target, split.percentage, index);\n }\n\n // Remove old prize splits configs. Match storage _prizesSplits.length with the passed newPrizeSplits.length\n while (_prizeSplits.length > newPrizeSplitsLength) {\n uint256 _index;\n unchecked {\n _index = _prizeSplits.length - 1;\n }\n _prizeSplits.pop();\n emit PrizeSplitRemoved(_index);\n }\n\n // Total prize split do not exceed 100%\n uint256 totalPercentage = _totalPrizeSplitPercentageAmount();\n require(totalPercentage <= ONE_AS_FIXED_POINT_3, \"PrizeSplit/invalid-prizesplit-percentage-total\");\n }\n\n /// @inheritdoc IPrizeSplit\n function setPrizeSplit(PrizeSplitConfig memory _prizeSplit, uint8 _prizeSplitIndex)\n external\n override\n onlyOwner\n {\n require(_prizeSplitIndex < _prizeSplits.length, \"PrizeSplit/nonexistent-prizesplit\");\n require(_prizeSplit.target != address(0), \"PrizeSplit/invalid-prizesplit-target\");\n\n // Update the prize split config\n _prizeSplits[_prizeSplitIndex] = _prizeSplit;\n\n // Total prize split do not exceed 100%\n uint256 totalPercentage = _totalPrizeSplitPercentageAmount();\n require(totalPercentage <= ONE_AS_FIXED_POINT_3, \"PrizeSplit/invalid-prizesplit-percentage-total\");\n\n // Emit updated prize split config\n emit PrizeSplitSet(\n _prizeSplit.target,\n _prizeSplit.percentage,\n _prizeSplitIndex\n );\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Calculates total prize split percentage amount.\n * @dev Calculates total PrizeSplitConfig percentage(s) amount. Used to check the total does not exceed 100% of award distribution.\n * @return Total prize split(s) percentage amount\n */\n function _totalPrizeSplitPercentageAmount() internal view returns (uint256) {\n uint256 _tempTotalPercentage;\n uint256 prizeSplitsLength = _prizeSplits.length;\n\n for (uint256 index = 0; index < prizeSplitsLength; index++) {\n _tempTotalPercentage += _prizeSplits[index].percentage;\n }\n\n return _tempTotalPercentage;\n }\n\n /**\n * @notice Distributes prize split(s).\n * @dev Distributes prize split(s) by awarding ticket or sponsorship tokens.\n * @param _prize Starting prize award amount\n * @return The remainder after splits are taken\n */\n function _distributePrizeSplits(uint256 _prize) internal returns (uint256) {\n uint256 _prizeTemp = _prize;\n uint256 prizeSplitsLength = _prizeSplits.length;\n\n for (uint256 index = 0; index < prizeSplitsLength; index++) {\n PrizeSplitConfig memory split = _prizeSplits[index];\n uint256 _splitAmount = (_prize * split.percentage) / 1000;\n\n // Award the prize split distribution amount.\n _awardPrizeSplitAmount(split.target, _splitAmount);\n\n // Update the remaining prize amount after distributing the prize split percentage.\n _prizeTemp -= _splitAmount;\n }\n\n return _prizeTemp;\n }\n\n /**\n * @notice Mints ticket or sponsorship tokens to prize split recipient.\n * @dev Mints ticket or sponsorship tokens to prize split recipient via the linked PrizePool contract.\n * @param _target Recipient of minted tokens\n * @param _amount Amount of minted tokens\n */\n function _awardPrizeSplitAmount(address _target, uint256 _amount) internal virtual;\n}\n" + }, + "@pooltogether/v4-core/contracts/interfaces/IPrizeSplit.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"./IControlledToken.sol\";\nimport \"./IPrizePool.sol\";\n\n/**\n * @title Abstract prize split contract for adding unique award distribution to static addresses.\n * @author PoolTogether Inc Team\n */\ninterface IPrizeSplit {\n /**\n * @notice Emit when an individual prize split is awarded.\n * @param user User address being awarded\n * @param prizeAwarded Awarded prize amount\n * @param token Token address\n */\n event PrizeSplitAwarded(\n address indexed user,\n uint256 prizeAwarded,\n IControlledToken indexed token\n );\n\n /**\n * @notice The prize split configuration struct.\n * @dev The prize split configuration struct used to award prize splits during distribution.\n * @param target Address of recipient receiving the prize split distribution\n * @param percentage Percentage of prize split using a 0-1000 range for single decimal precision i.e. 125 = 12.5%\n */\n struct PrizeSplitConfig {\n address target;\n uint16 percentage;\n }\n\n /**\n * @notice Emitted when a PrizeSplitConfig config is added or updated.\n * @dev Emitted when a PrizeSplitConfig config is added or updated in setPrizeSplits or setPrizeSplit.\n * @param target Address of prize split recipient\n * @param percentage Percentage of prize split. Must be between 0 and 1000 for single decimal precision\n * @param index Index of prize split in the prizeSplts array\n */\n event PrizeSplitSet(address indexed target, uint16 percentage, uint256 index);\n\n /**\n * @notice Emitted when a PrizeSplitConfig config is removed.\n * @dev Emitted when a PrizeSplitConfig config is removed from the prizeSplits array.\n * @param target Index of a previously active prize split config\n */\n event PrizeSplitRemoved(uint256 indexed target);\n\n /**\n * @notice Read prize split config from active PrizeSplits.\n * @dev Read PrizeSplitConfig struct from prizeSplits array.\n * @param prizeSplitIndex Index position of PrizeSplitConfig\n * @return PrizeSplitConfig Single prize split config\n */\n function getPrizeSplit(uint256 prizeSplitIndex) external view returns (PrizeSplitConfig memory);\n\n /**\n * @notice Read all prize splits configs.\n * @dev Read all PrizeSplitConfig structs stored in prizeSplits.\n * @return Array of PrizeSplitConfig structs\n */\n function getPrizeSplits() external view returns (PrizeSplitConfig[] memory);\n\n /**\n * @notice Get PrizePool address\n * @return IPrizePool\n */\n function getPrizePool() external view returns (IPrizePool);\n\n /**\n * @notice Set and remove prize split(s) configs. Only callable by owner.\n * @dev Set and remove prize split configs by passing a new PrizeSplitConfig structs array. Will remove existing PrizeSplitConfig(s) if passed array length is less than existing prizeSplits length.\n * @param newPrizeSplits Array of PrizeSplitConfig structs\n */\n function setPrizeSplits(PrizeSplitConfig[] calldata newPrizeSplits) external;\n\n /**\n * @notice Updates a previously set prize split config.\n * @dev Updates a prize split config by passing a new PrizeSplitConfig struct and current index position. Limited to contract owner.\n * @param prizeStrategySplit PrizeSplitConfig config struct\n * @param prizeSplitIndex Index position of PrizeSplitConfig to update\n */\n function setPrizeSplit(PrizeSplitConfig memory prizeStrategySplit, uint8 prizeSplitIndex)\n external;\n}\n" + }, + "@pooltogether/v4-core/contracts/interfaces/IPrizePool.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"../external/compound/ICompLike.sol\";\nimport \"../interfaces/ITicket.sol\";\n\ninterface IPrizePool {\n /// @dev Event emitted when controlled token is added\n event ControlledTokenAdded(ITicket indexed token);\n\n event AwardCaptured(uint256 amount);\n\n /// @dev Event emitted when assets are deposited\n event Deposited(\n address indexed operator,\n address indexed to,\n ITicket indexed token,\n uint256 amount\n );\n\n /// @dev Event emitted when interest is awarded to a winner\n event Awarded(address indexed winner, ITicket indexed token, uint256 amount);\n\n /// @dev Event emitted when external ERC20s are awarded to a winner\n event AwardedExternalERC20(address indexed winner, address indexed token, uint256 amount);\n\n /// @dev Event emitted when external ERC20s are transferred out\n event TransferredExternalERC20(address indexed to, address indexed token, uint256 amount);\n\n /// @dev Event emitted when external ERC721s are awarded to a winner\n event AwardedExternalERC721(address indexed winner, address indexed token, uint256[] tokenIds);\n\n /// @dev Event emitted when assets are withdrawn\n event Withdrawal(\n address indexed operator,\n address indexed from,\n ITicket indexed token,\n uint256 amount,\n uint256 redeemed\n );\n\n /// @dev Event emitted when the Balance Cap is set\n event BalanceCapSet(uint256 balanceCap);\n\n /// @dev Event emitted when the Liquidity Cap is set\n event LiquidityCapSet(uint256 liquidityCap);\n\n /// @dev Event emitted when the Prize Strategy is set\n event PrizeStrategySet(address indexed prizeStrategy);\n\n /// @dev Event emitted when the Ticket is set\n event TicketSet(ITicket indexed ticket);\n\n /// @dev Emitted when there was an error thrown awarding an External ERC721\n event ErrorAwardingExternalERC721(bytes error);\n\n /// @notice Deposit assets into the Prize Pool in exchange for tokens\n /// @param to The address receiving the newly minted tokens\n /// @param amount The amount of assets to deposit\n function depositTo(address to, uint256 amount) external;\n\n /// @notice Deposit assets into the Prize Pool in exchange for tokens,\n /// then sets the delegate on behalf of the caller.\n /// @param to The address receiving the newly minted tokens\n /// @param amount The amount of assets to deposit\n /// @param delegate The address to delegate to for the caller\n function depositToAndDelegate(address to, uint256 amount, address delegate) external;\n\n /// @notice Withdraw assets from the Prize Pool instantly. A fairness fee may be charged for an early exit.\n /// @param from The address to redeem tokens from.\n /// @param amount The amount of tokens to redeem for assets.\n /// @return The actual amount withdrawn\n function withdrawFrom(address from, uint256 amount) external returns (uint256);\n\n /// @notice Called by the prize strategy to award prizes.\n /// @dev The amount awarded must be less than the awardBalance()\n /// @param to The address of the winner that receives the award\n /// @param amount The amount of assets to be awarded\n function award(address to, uint256 amount) external;\n\n /// @notice Returns the balance that is available to award.\n /// @dev captureAwardBalance() should be called first\n /// @return The total amount of assets to be awarded for the current prize\n function awardBalance() external view returns (uint256);\n\n /// @notice Captures any available interest as award balance.\n /// @dev This function also captures the reserve fees.\n /// @return The total amount of assets to be awarded for the current prize\n function captureAwardBalance() external returns (uint256);\n\n /// @dev Checks with the Prize Pool if a specific token type may be awarded as an external prize\n /// @param externalToken The address of the token to check\n /// @return True if the token may be awarded, false otherwise\n function canAwardExternal(address externalToken) external view returns (bool);\n\n // @dev Returns the total underlying balance of all assets. This includes both principal and interest.\n /// @return The underlying balance of assets\n function balance() external returns (uint256);\n\n /**\n * @notice Read internal Ticket accounted balance.\n * @return uint256 accountBalance\n */\n function getAccountedBalance() external view returns (uint256);\n\n /**\n * @notice Read internal balanceCap variable\n */\n function getBalanceCap() external view returns (uint256);\n\n /**\n * @notice Read internal liquidityCap variable\n */\n function getLiquidityCap() external view returns (uint256);\n\n /**\n * @notice Read ticket variable\n */\n function getTicket() external view returns (ITicket);\n\n /**\n * @notice Read token variable\n */\n function getToken() external view returns (address);\n\n /**\n * @notice Read prizeStrategy variable\n */\n function getPrizeStrategy() external view returns (address);\n\n /// @dev Checks if a specific token is controlled by the Prize Pool\n /// @param controlledToken The address of the token to check\n /// @return True if the token is a controlled token, false otherwise\n function isControlled(ITicket controlledToken) external view returns (bool);\n\n /// @notice Called by the Prize-Strategy to transfer out external ERC20 tokens\n /// @dev Used to transfer out tokens held by the Prize Pool. Could be liquidated, or anything.\n /// @param to The address of the winner that receives the award\n /// @param externalToken The address of the external asset token being awarded\n /// @param amount The amount of external assets to be awarded\n function transferExternalERC20(\n address to,\n address externalToken,\n uint256 amount\n ) external;\n\n /// @notice Called by the Prize-Strategy to award external ERC20 prizes\n /// @dev Used to award any arbitrary tokens held by the Prize Pool\n /// @param to The address of the winner that receives the award\n /// @param amount The amount of external assets to be awarded\n /// @param externalToken The address of the external asset token being awarded\n function awardExternalERC20(\n address to,\n address externalToken,\n uint256 amount\n ) external;\n\n /// @notice Called by the prize strategy to award external ERC721 prizes\n /// @dev Used to award any arbitrary NFTs held by the Prize Pool\n /// @param to The address of the winner that receives the award\n /// @param externalToken The address of the external NFT token being awarded\n /// @param tokenIds An array of NFT Token IDs to be transferred\n function awardExternalERC721(\n address to,\n address externalToken,\n uint256[] calldata tokenIds\n ) external;\n\n /// @notice Allows the owner to set a balance cap per `token` for the pool.\n /// @dev If a user wins, his balance can go over the cap. He will be able to withdraw the excess but not deposit.\n /// @dev Needs to be called after deploying a prize pool to be able to deposit into it.\n /// @param balanceCap New balance cap.\n /// @return True if new balance cap has been successfully set.\n function setBalanceCap(uint256 balanceCap) external returns (bool);\n\n /// @notice Allows the Governor to set a cap on the amount of liquidity that he pool can hold\n /// @param liquidityCap The new liquidity cap for the prize pool\n function setLiquidityCap(uint256 liquidityCap) external;\n\n /// @notice Sets the prize strategy of the prize pool. Only callable by the owner.\n /// @param _prizeStrategy The new prize strategy.\n function setPrizeStrategy(address _prizeStrategy) external;\n\n /// @notice Set prize pool ticket.\n /// @param ticket Address of the ticket to set.\n /// @return True if ticket has been successfully set.\n function setTicket(ITicket ticket) external returns (bool);\n\n /// @notice Delegate the votes for a Compound COMP-like token held by the prize pool\n /// @param compLike The COMP-like token held by the prize pool that should be delegated\n /// @param to The address to delegate to\n function compLikeDelegate(ICompLike compLike, address to) external;\n}\n" + }, + "@pooltogether/v4-core/contracts/external/compound/ICompLike.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface ICompLike is IERC20 {\n function getCurrentVotes(address account) external view returns (uint96);\n\n function delegate(address delegate) external;\n}\n" + }, + "@pooltogether/v4-core/contracts/prize-strategy/PrizeSplitStrategy.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"./PrizeSplit.sol\";\nimport \"../interfaces/IStrategy.sol\";\nimport \"../interfaces/IPrizePool.sol\";\n\n/**\n * @title PoolTogether V4 PrizeSplitStrategy\n * @author PoolTogether Inc Team\n * @notice Captures PrizePool interest for PrizeReserve and additional PrizeSplit recipients.\n The PrizeSplitStrategy will have at minimum a single PrizeSplit with 100% of the captured\n interest transfered to the PrizeReserve. Additional PrizeSplits can be added, depending on\n the deployers requirements (i.e. percentage to charity). In contrast to previous PoolTogether\n iterations, interest can be captured independent of a new Draw. Ideally (to save gas) interest\n is only captured when also distributing the captured prize(s) to applicable Prize Distributor(s).\n*/\ncontract PrizeSplitStrategy is PrizeSplit, IStrategy {\n /**\n * @notice PrizePool address\n */\n IPrizePool internal immutable prizePool;\n\n /**\n * @notice Deployed Event\n * @param owner Contract owner\n * @param prizePool Linked PrizePool contract\n */\n event Deployed(address indexed owner, IPrizePool prizePool);\n\n /* ============ Constructor ============ */\n\n /**\n * @notice Deploy the PrizeSplitStrategy smart contract.\n * @param _owner Owner address\n * @param _prizePool PrizePool address\n */\n constructor(address _owner, IPrizePool _prizePool) Ownable(_owner) {\n require(\n address(_prizePool) != address(0),\n \"PrizeSplitStrategy/prize-pool-not-zero-address\"\n );\n prizePool = _prizePool;\n emit Deployed(_owner, _prizePool);\n }\n\n /* ============ External Functions ============ */\n\n /// @inheritdoc IStrategy\n function distribute() external override returns (uint256) {\n uint256 prize = prizePool.captureAwardBalance();\n\n if (prize == 0) return 0;\n\n uint256 prizeRemaining = _distributePrizeSplits(prize);\n\n emit Distributed(prize - prizeRemaining);\n\n return prize;\n }\n\n /// @inheritdoc IPrizeSplit\n function getPrizePool() external view override returns (IPrizePool) {\n return prizePool;\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Award ticket tokens to prize split recipient.\n * @dev Award ticket tokens to prize split recipient via the linked PrizePool contract.\n * @param _to Recipient of minted tokens.\n * @param _amount Amount of minted tokens.\n */\n function _awardPrizeSplitAmount(address _to, uint256 _amount) internal override {\n IControlledToken _ticket = prizePool.getTicket();\n prizePool.award(_to, _amount);\n emit PrizeSplitAwarded(_to, _amount, _ticket);\n }\n}\n" + }, + "@pooltogether/v4-core/contracts/interfaces/IStrategy.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\ninterface IStrategy {\n /**\n * @notice Emit when a strategy captures award amount from PrizePool.\n * @param totalPrizeCaptured Total prize captured from the PrizePool\n */\n event Distributed(uint256 totalPrizeCaptured);\n\n /**\n * @notice Capture the award balance and distribute to prize splits.\n * @dev Permissionless function to initialize distribution of interst\n * @return Prize captured from PrizePool\n */\n function distribute() external returns (uint256);\n}\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-core/contracts/prize-strategy/PrizeSplitStrategy.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-core/contracts/prize-strategy/PrizeSplitStrategy.sol';\n" + }, + "@pooltogether/v4-core/contracts/prize-pool/PrizePool.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport \"@openzeppelin/contracts/security/ReentrancyGuard.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165Checker.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@pooltogether/owner-manager-contracts/contracts/Ownable.sol\";\n\nimport \"../external/compound/ICompLike.sol\";\nimport \"../interfaces/IPrizePool.sol\";\nimport \"../interfaces/ITicket.sol\";\n\n/**\n * @title PoolTogether V4 PrizePool\n * @author PoolTogether Inc Team\n * @notice Escrows assets and deposits them into a yield source. Exposes interest to Prize Strategy.\n Users deposit and withdraw from this contract to participate in Prize Pool.\n Accounting is managed using Controlled Tokens, whose mint and burn functions can only be called by this contract.\n Must be inherited to provide specific yield-bearing asset control, such as Compound cTokens\n*/\nabstract contract PrizePool is IPrizePool, Ownable, ReentrancyGuard, IERC721Receiver {\n using SafeCast for uint256;\n using SafeERC20 for IERC20;\n using ERC165Checker for address;\n\n /// @notice Semver Version\n string public constant VERSION = \"4.0.0\";\n\n /// @notice Prize Pool ticket. Can only be set once by calling `setTicket()`.\n ITicket internal ticket;\n\n /// @notice The Prize Strategy that this Prize Pool is bound to.\n address internal prizeStrategy;\n\n /// @notice The total amount of tickets a user can hold.\n uint256 internal balanceCap;\n\n /// @notice The total amount of funds that the prize pool can hold.\n uint256 internal liquidityCap;\n\n /// @notice the The awardable balance\n uint256 internal _currentAwardBalance;\n\n /* ============ Modifiers ============ */\n\n /// @dev Function modifier to ensure caller is the prize-strategy\n modifier onlyPrizeStrategy() {\n require(msg.sender == prizeStrategy, \"PrizePool/only-prizeStrategy\");\n _;\n }\n\n /// @dev Function modifier to ensure the deposit amount does not exceed the liquidity cap (if set)\n modifier canAddLiquidity(uint256 _amount) {\n require(_canAddLiquidity(_amount), \"PrizePool/exceeds-liquidity-cap\");\n _;\n }\n\n /* ============ Constructor ============ */\n\n /// @notice Deploy the Prize Pool\n /// @param _owner Address of the Prize Pool owner\n constructor(address _owner) Ownable(_owner) ReentrancyGuard() {\n _setLiquidityCap(type(uint256).max);\n }\n\n /* ============ External Functions ============ */\n\n /// @inheritdoc IPrizePool\n function balance() external override returns (uint256) {\n return _balance();\n }\n\n /// @inheritdoc IPrizePool\n function awardBalance() external view override returns (uint256) {\n return _currentAwardBalance;\n }\n\n /// @inheritdoc IPrizePool\n function canAwardExternal(address _externalToken) external view override returns (bool) {\n return _canAwardExternal(_externalToken);\n }\n\n /// @inheritdoc IPrizePool\n function isControlled(ITicket _controlledToken) external view override returns (bool) {\n return _isControlled(_controlledToken);\n }\n\n /// @inheritdoc IPrizePool\n function getAccountedBalance() external view override returns (uint256) {\n return _ticketTotalSupply();\n }\n\n /// @inheritdoc IPrizePool\n function getBalanceCap() external view override returns (uint256) {\n return balanceCap;\n }\n\n /// @inheritdoc IPrizePool\n function getLiquidityCap() external view override returns (uint256) {\n return liquidityCap;\n }\n\n /// @inheritdoc IPrizePool\n function getTicket() external view override returns (ITicket) {\n return ticket;\n }\n\n /// @inheritdoc IPrizePool\n function getPrizeStrategy() external view override returns (address) {\n return prizeStrategy;\n }\n\n /// @inheritdoc IPrizePool\n function getToken() external view override returns (address) {\n return address(_token());\n }\n\n /// @inheritdoc IPrizePool\n function captureAwardBalance() external override nonReentrant returns (uint256) {\n uint256 ticketTotalSupply = _ticketTotalSupply();\n uint256 currentAwardBalance = _currentAwardBalance;\n\n // it's possible for the balance to be slightly less due to rounding errors in the underlying yield source\n uint256 currentBalance = _balance();\n uint256 totalInterest = (currentBalance > ticketTotalSupply)\n ? currentBalance - ticketTotalSupply\n : 0;\n\n uint256 unaccountedPrizeBalance = (totalInterest > currentAwardBalance)\n ? totalInterest - currentAwardBalance\n : 0;\n\n if (unaccountedPrizeBalance > 0) {\n currentAwardBalance = totalInterest;\n _currentAwardBalance = currentAwardBalance;\n\n emit AwardCaptured(unaccountedPrizeBalance);\n }\n\n return currentAwardBalance;\n }\n\n /// @inheritdoc IPrizePool\n function depositTo(address _to, uint256 _amount)\n external\n override\n nonReentrant\n canAddLiquidity(_amount)\n {\n _depositTo(msg.sender, _to, _amount);\n }\n\n /// @inheritdoc IPrizePool\n function depositToAndDelegate(address _to, uint256 _amount, address _delegate)\n external\n override\n nonReentrant\n canAddLiquidity(_amount)\n {\n _depositTo(msg.sender, _to, _amount);\n ticket.controllerDelegateFor(msg.sender, _delegate);\n }\n\n /// @notice Transfers tokens in from one user and mints tickets to another\n /// @notice _operator The user to transfer tokens from\n /// @notice _to The user to mint tickets to\n /// @notice _amount The amount to transfer and mint\n function _depositTo(address _operator, address _to, uint256 _amount) internal\n {\n require(_canDeposit(_to, _amount), \"PrizePool/exceeds-balance-cap\");\n\n ITicket _ticket = ticket;\n\n _token().safeTransferFrom(_operator, address(this), _amount);\n\n _mint(_to, _amount, _ticket);\n _supply(_amount);\n\n emit Deposited(_operator, _to, _ticket, _amount);\n }\n\n /// @inheritdoc IPrizePool\n function withdrawFrom(address _from, uint256 _amount)\n external\n override\n nonReentrant\n returns (uint256)\n {\n ITicket _ticket = ticket;\n\n // burn the tickets\n _ticket.controllerBurnFrom(msg.sender, _from, _amount);\n\n // redeem the tickets\n uint256 _redeemed = _redeem(_amount);\n\n _token().safeTransfer(_from, _redeemed);\n\n emit Withdrawal(msg.sender, _from, _ticket, _amount, _redeemed);\n\n return _redeemed;\n }\n\n /// @inheritdoc IPrizePool\n function award(address _to, uint256 _amount) external override onlyPrizeStrategy {\n if (_amount == 0) {\n return;\n }\n\n uint256 currentAwardBalance = _currentAwardBalance;\n\n require(_amount <= currentAwardBalance, \"PrizePool/award-exceeds-avail\");\n\n unchecked {\n _currentAwardBalance = currentAwardBalance - _amount;\n }\n\n ITicket _ticket = ticket;\n\n _mint(_to, _amount, _ticket);\n\n emit Awarded(_to, _ticket, _amount);\n }\n\n /// @inheritdoc IPrizePool\n function transferExternalERC20(\n address _to,\n address _externalToken,\n uint256 _amount\n ) external override onlyPrizeStrategy {\n if (_transferOut(_to, _externalToken, _amount)) {\n emit TransferredExternalERC20(_to, _externalToken, _amount);\n }\n }\n\n /// @inheritdoc IPrizePool\n function awardExternalERC20(\n address _to,\n address _externalToken,\n uint256 _amount\n ) external override onlyPrizeStrategy {\n if (_transferOut(_to, _externalToken, _amount)) {\n emit AwardedExternalERC20(_to, _externalToken, _amount);\n }\n }\n\n /// @inheritdoc IPrizePool\n function awardExternalERC721(\n address _to,\n address _externalToken,\n uint256[] calldata _tokenIds\n ) external override onlyPrizeStrategy {\n require(_canAwardExternal(_externalToken), \"PrizePool/invalid-external-token\");\n\n if (_tokenIds.length == 0) {\n return;\n }\n\n uint256[] memory _awardedTokenIds = new uint256[](_tokenIds.length); \n bool hasAwardedTokenIds;\n\n for (uint256 i = 0; i < _tokenIds.length; i++) {\n try IERC721(_externalToken).safeTransferFrom(address(this), _to, _tokenIds[i]) {\n hasAwardedTokenIds = true;\n _awardedTokenIds[i] = _tokenIds[i];\n } catch (\n bytes memory error\n ) {\n emit ErrorAwardingExternalERC721(error);\n }\n }\n if (hasAwardedTokenIds) { \n emit AwardedExternalERC721(_to, _externalToken, _awardedTokenIds);\n }\n }\n\n /// @inheritdoc IPrizePool\n function setBalanceCap(uint256 _balanceCap) external override onlyOwner returns (bool) {\n _setBalanceCap(_balanceCap);\n return true;\n }\n\n /// @inheritdoc IPrizePool\n function setLiquidityCap(uint256 _liquidityCap) external override onlyOwner {\n _setLiquidityCap(_liquidityCap);\n }\n\n /// @inheritdoc IPrizePool\n function setTicket(ITicket _ticket) external override onlyOwner returns (bool) {\n require(address(_ticket) != address(0), \"PrizePool/ticket-not-zero-address\");\n require(address(ticket) == address(0), \"PrizePool/ticket-already-set\");\n\n ticket = _ticket;\n\n emit TicketSet(_ticket);\n\n _setBalanceCap(type(uint256).max);\n\n return true;\n }\n\n /// @inheritdoc IPrizePool\n function setPrizeStrategy(address _prizeStrategy) external override onlyOwner {\n _setPrizeStrategy(_prizeStrategy);\n }\n\n /// @inheritdoc IPrizePool\n function compLikeDelegate(ICompLike _compLike, address _to) external override onlyOwner {\n if (_compLike.balanceOf(address(this)) > 0) {\n _compLike.delegate(_to);\n }\n }\n\n /// @inheritdoc IERC721Receiver\n function onERC721Received(\n address,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return IERC721Receiver.onERC721Received.selector;\n }\n\n /* ============ Internal Functions ============ */\n\n /// @notice Transfer out `amount` of `externalToken` to recipient `to`\n /// @dev Only awardable `externalToken` can be transferred out\n /// @param _to Recipient address\n /// @param _externalToken Address of the external asset token being transferred\n /// @param _amount Amount of external assets to be transferred\n /// @return True if transfer is successful\n function _transferOut(\n address _to,\n address _externalToken,\n uint256 _amount\n ) internal returns (bool) {\n require(_canAwardExternal(_externalToken), \"PrizePool/invalid-external-token\");\n\n if (_amount == 0) {\n return false;\n }\n\n IERC20(_externalToken).safeTransfer(_to, _amount);\n\n return true;\n }\n\n /// @notice Called to mint controlled tokens. Ensures that token listener callbacks are fired.\n /// @param _to The user who is receiving the tokens\n /// @param _amount The amount of tokens they are receiving\n /// @param _controlledToken The token that is going to be minted\n function _mint(\n address _to,\n uint256 _amount,\n ITicket _controlledToken\n ) internal {\n _controlledToken.controllerMint(_to, _amount);\n }\n\n /// @dev Checks if `user` can deposit in the Prize Pool based on the current balance cap.\n /// @param _user Address of the user depositing.\n /// @param _amount The amount of tokens to be deposited into the Prize Pool.\n /// @return True if the Prize Pool can receive the specified `amount` of tokens.\n function _canDeposit(address _user, uint256 _amount) internal view returns (bool) {\n uint256 _balanceCap = balanceCap;\n\n if (_balanceCap == type(uint256).max) return true;\n\n return (ticket.balanceOf(_user) + _amount <= _balanceCap);\n }\n\n /// @dev Checks if the Prize Pool can receive liquidity based on the current cap\n /// @param _amount The amount of liquidity to be added to the Prize Pool\n /// @return True if the Prize Pool can receive the specified amount of liquidity\n function _canAddLiquidity(uint256 _amount) internal view returns (bool) {\n uint256 _liquidityCap = liquidityCap;\n if (_liquidityCap == type(uint256).max) return true;\n return (_ticketTotalSupply() + _amount <= _liquidityCap);\n }\n\n /// @dev Checks if a specific token is controlled by the Prize Pool\n /// @param _controlledToken The address of the token to check\n /// @return True if the token is a controlled token, false otherwise\n function _isControlled(ITicket _controlledToken) internal view returns (bool) {\n return (ticket == _controlledToken);\n }\n\n /// @notice Allows the owner to set a balance cap per `token` for the pool.\n /// @param _balanceCap New balance cap.\n function _setBalanceCap(uint256 _balanceCap) internal {\n balanceCap = _balanceCap;\n emit BalanceCapSet(_balanceCap);\n }\n\n /// @notice Allows the owner to set a liquidity cap for the pool\n /// @param _liquidityCap New liquidity cap\n function _setLiquidityCap(uint256 _liquidityCap) internal {\n liquidityCap = _liquidityCap;\n emit LiquidityCapSet(_liquidityCap);\n }\n\n /// @notice Sets the prize strategy of the prize pool. Only callable by the owner.\n /// @param _prizeStrategy The new prize strategy\n function _setPrizeStrategy(address _prizeStrategy) internal {\n require(_prizeStrategy != address(0), \"PrizePool/prizeStrategy-not-zero\");\n\n prizeStrategy = _prizeStrategy;\n\n emit PrizeStrategySet(_prizeStrategy);\n }\n\n /// @notice The current total of tickets.\n /// @return Ticket total supply.\n function _ticketTotalSupply() internal view returns (uint256) {\n return ticket.totalSupply();\n }\n\n /// @dev Gets the current time as represented by the current block\n /// @return The timestamp of the current block\n function _currentTime() internal view virtual returns (uint256) {\n return block.timestamp;\n }\n\n /* ============ Abstract Contract Implementatiton ============ */\n\n /// @notice Determines whether the passed token can be transferred out as an external award.\n /// @dev Different yield sources will hold the deposits as another kind of token: such a Compound's cToken. The\n /// prize strategy should not be allowed to move those tokens.\n /// @param _externalToken The address of the token to check\n /// @return True if the token may be awarded, false otherwise\n function _canAwardExternal(address _externalToken) internal view virtual returns (bool);\n\n /// @notice Returns the ERC20 asset token used for deposits.\n /// @return The ERC20 asset token\n function _token() internal view virtual returns (IERC20);\n\n /// @notice Returns the total balance (in asset tokens). This includes the deposits and interest.\n /// @return The underlying balance of asset tokens\n function _balance() internal virtual returns (uint256);\n\n /// @notice Supplies asset tokens to the yield source.\n /// @param _mintAmount The amount of asset tokens to be supplied\n function _supply(uint256 _mintAmount) internal virtual;\n\n /// @notice Redeems asset tokens from the yield source.\n /// @param _redeemAmount The amount of yield-bearing tokens to be redeemed\n /// @return The actual amount of tokens that were redeemed.\n function _redeem(uint256 _redeemAmount) internal virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/security/ReentrancyGuard.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n constructor() {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165Checker.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Library used to query support of an interface declared via {IERC165}.\n *\n * Note that these functions return the actual result of the query: they do not\n * `revert` if an interface is not supported. It is up to the caller to decide\n * what to do in these cases.\n */\nlibrary ERC165Checker {\n // As per the EIP-165 spec, no interface should ever match 0xffffffff\n bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;\n\n /**\n * @dev Returns true if `account` supports the {IERC165} interface,\n */\n function supportsERC165(address account) internal view returns (bool) {\n // Any contract that implements ERC165 must explicitly indicate support of\n // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid\n return\n _supportsERC165Interface(account, type(IERC165).interfaceId) &&\n !_supportsERC165Interface(account, _INTERFACE_ID_INVALID);\n }\n\n /**\n * @dev Returns true if `account` supports the interface defined by\n * `interfaceId`. Support for {IERC165} itself is queried automatically.\n *\n * See {IERC165-supportsInterface}.\n */\n function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {\n // query support of both ERC165 as per the spec and support of _interfaceId\n return supportsERC165(account) && _supportsERC165Interface(account, interfaceId);\n }\n\n /**\n * @dev Returns a boolean array where each value corresponds to the\n * interfaces passed in and whether they're supported or not. This allows\n * you to batch check interfaces for a contract where your expectation\n * is that some interfaces may not be supported.\n *\n * See {IERC165-supportsInterface}.\n *\n * _Available since v3.4._\n */\n function getSupportedInterfaces(address account, bytes4[] memory interfaceIds)\n internal\n view\n returns (bool[] memory)\n {\n // an array of booleans corresponding to interfaceIds and whether they're supported or not\n bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);\n\n // query support of ERC165 itself\n if (supportsERC165(account)) {\n // query support of each interface in interfaceIds\n for (uint256 i = 0; i < interfaceIds.length; i++) {\n interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]);\n }\n }\n\n return interfaceIdsSupported;\n }\n\n /**\n * @dev Returns true if `account` supports all the interfaces defined in\n * `interfaceIds`. Support for {IERC165} itself is queried automatically.\n *\n * Batch-querying can lead to gas savings by skipping repeated checks for\n * {IERC165} support.\n *\n * See {IERC165-supportsInterface}.\n */\n function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {\n // query support of ERC165 itself\n if (!supportsERC165(account)) {\n return false;\n }\n\n // query support of each interface in _interfaceIds\n for (uint256 i = 0; i < interfaceIds.length; i++) {\n if (!_supportsERC165Interface(account, interfaceIds[i])) {\n return false;\n }\n }\n\n // all interfaces supported\n return true;\n }\n\n /**\n * @notice Query if a contract implements an interface, does not check ERC165 support\n * @param account The address of the contract to query for support of an interface\n * @param interfaceId The interface identifier, as specified in ERC-165\n * @return true if the contract at account indicates support of the interface with\n * identifier interfaceId, false otherwise\n * @dev Assumes that account contains a contract that supports ERC165, otherwise\n * the behavior of this method is undefined. This precondition can be checked\n * with {supportsERC165}.\n * Interface identification is specified in ERC-165.\n */\n function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {\n bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);\n (bool success, bytes memory result) = account.staticcall{gas: 30000}(encodedParams);\n if (result.length < 32) return false;\n return success && abi.decode(result, (bool));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@pooltogether/v4-twab-delegator/contracts/TWABDelegator.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/proxy/Clones.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@pooltogether/v4-core/contracts/interfaces/ITicket.sol\";\n\nimport \"./Delegation.sol\";\nimport \"./LowLevelDelegator.sol\";\nimport \"./PermitAndMulticall.sol\";\n\n/**\n * @title Delegate chances to win to multiple accounts.\n * @notice This contract allows accounts to easily delegate a portion of their tickets to multiple delegatees.\n The delegatees chance of winning prizes is increased by the delegated amount.\n If a delegator doesn't want to actively manage the delegations, then they can stake on the contract and appoint representatives.\n */\ncontract TWABDelegator is ERC20, LowLevelDelegator, PermitAndMulticall {\n using Address for address;\n using Clones for address;\n using SafeERC20 for IERC20;\n\n /* ============ Events ============ */\n\n /**\n * @notice Emitted when ticket associated with this contract has been set.\n * @param ticket Address of the ticket\n */\n event TicketSet(ITicket indexed ticket);\n\n /**\n * @notice Emitted when tickets have been staked.\n * @param delegator Address of the delegator\n * @param amount Amount of tickets staked\n */\n event TicketsStaked(address indexed delegator, uint256 amount);\n\n /**\n * @notice Emitted when tickets have been unstaked.\n * @param delegator Address of the delegator\n * @param recipient Address of the recipient that will receive the tickets\n * @param amount Amount of tickets unstaked\n */\n event TicketsUnstaked(address indexed delegator, address indexed recipient, uint256 amount);\n\n /**\n * @notice Emitted when a new delegation is created.\n * @param delegator Delegator of the delegation\n * @param slot Slot of the delegation\n * @param lockUntil Timestamp until which the delegation is locked\n * @param delegatee Address of the delegatee\n * @param delegation Address of the delegation that was created\n * @param user Address of the user who created the delegation\n */\n event DelegationCreated(\n address indexed delegator,\n uint256 indexed slot,\n uint96 lockUntil,\n address indexed delegatee,\n Delegation delegation,\n address user\n );\n\n /**\n * @notice Emitted when a delegatee is updated.\n * @param delegator Address of the delegator\n * @param slot Slot of the delegation\n * @param delegatee Address of the delegatee\n * @param lockUntil Timestamp until which the delegation is locked\n * @param user Address of the user who updated the delegatee\n */\n event DelegateeUpdated(\n address indexed delegator,\n uint256 indexed slot,\n address indexed delegatee,\n uint96 lockUntil,\n address user\n );\n\n /**\n * @notice Emitted when a delegation is funded.\n * @param delegator Address of the delegator\n * @param slot Slot of the delegation\n * @param amount Amount of tickets that were sent to the delegation\n * @param user Address of the user who funded the delegation\n */\n event DelegationFunded(\n address indexed delegator,\n uint256 indexed slot,\n uint256 amount,\n address indexed user\n );\n\n /**\n * @notice Emitted when a delegation is funded from the staked amount.\n * @param delegator Address of the delegator\n * @param slot Slot of the delegation\n * @param amount Amount of tickets that were sent to the delegation\n * @param user Address of the user who pulled funds from the delegator stake to the delegation\n */\n event DelegationFundedFromStake(\n address indexed delegator,\n uint256 indexed slot,\n uint256 amount,\n address indexed user\n );\n\n /**\n * @notice Emitted when an amount of tickets has been withdrawn from a delegation. The tickets are held by this contract and the delegator stake is increased.\n * @param delegator Address of the delegator\n * @param slot Slot of the delegation\n * @param amount Amount of tickets withdrawn\n * @param user Address of the user who withdrew the tickets\n */\n event WithdrewDelegationToStake(\n address indexed delegator,\n uint256 indexed slot,\n uint256 amount,\n address indexed user\n );\n\n /**\n * @notice Emitted when a delegator withdraws an amount of tickets from a delegation to a specified wallet.\n * @param delegator Address of the delegator\n * @param slot Slot of the delegation\n * @param amount Amount of tickets withdrawn\n * @param to Recipient address of withdrawn tickets\n */\n event TransferredDelegation(\n address indexed delegator,\n uint256 indexed slot,\n uint256 amount,\n address indexed to\n );\n\n /**\n * @notice Emitted when a representative is set.\n * @param delegator Address of the delegator\n * @param representative Address of the representative\n * @param set Boolean indicating if the representative was set or unset\n */\n event RepresentativeSet(address indexed delegator, address indexed representative, bool set);\n\n /* ============ Variables ============ */\n\n /// @notice Prize pool ticket to which this contract is tied to.\n ITicket public immutable ticket;\n\n /// @notice Max lock time during which a delegation cannot be updated.\n uint256 public constant MAX_LOCK = 180 days;\n\n /**\n * @notice Representative elected by the delegator to handle delegation.\n * @dev Representative can only handle delegation and cannot withdraw tickets to their wallet.\n * @dev delegator => representative => bool allowing representative to represent the delegator\n */\n mapping(address => mapping(address => bool)) internal representatives;\n\n /* ============ Constructor ============ */\n\n /**\n * @notice Creates a new TWAB Delegator that is bound to the given ticket contract.\n * @param name_ The name for the staked ticket token\n * @param symbol_ The symbol for the staked ticket token\n * @param _ticket Address of the ticket contract\n */\n constructor(\n string memory name_,\n string memory symbol_,\n ITicket _ticket\n ) LowLevelDelegator() ERC20(name_, symbol_) {\n require(address(_ticket) != address(0), \"TWABDelegator/tick-not-zero-addr\");\n ticket = _ticket;\n\n emit TicketSet(_ticket);\n }\n\n /* ============ External Functions ============ */\n\n /**\n * @notice Stake `_amount` of tickets in this contract.\n * @dev Tickets can be staked on behalf of a `_to` user.\n * @param _to Address to which the stake will be attributed\n * @param _amount Amount of tickets to stake\n */\n function stake(address _to, uint256 _amount) external {\n _requireAmountGtZero(_amount);\n\n IERC20(ticket).safeTransferFrom(msg.sender, address(this), _amount);\n _mint(_to, _amount);\n\n emit TicketsStaked(_to, _amount);\n }\n\n /**\n * @notice Unstake `_amount` of tickets from this contract. Transfers ticket to the passed `_to` address.\n * @dev If delegator has delegated his whole stake, he will first have to withdraw from a delegation to be able to unstake.\n * @param _to Address of the recipient that will receive the tickets\n * @param _amount Amount of tickets to unstake\n */\n function unstake(address _to, uint256 _amount) external {\n _requireRecipientNotZeroAddress(_to);\n _requireAmountGtZero(_amount);\n\n _burn(msg.sender, _amount);\n\n IERC20(ticket).safeTransfer(_to, _amount);\n\n emit TicketsUnstaked(msg.sender, _to, _amount);\n }\n\n /**\n * @notice Creates a new delegation.\n This will create a new Delegation contract for the given slot and have it delegate its tickets to the given delegatee.\n If a non-zero lock duration is passed, then the delegatee cannot be changed, nor funding withdrawn, until the lock has expired.\n * @dev The `_delegator` and `_slot` params are used to compute the salt of the delegation\n * @param _delegator Address of the delegator that will be able to handle the delegation\n * @param _slot Slot of the delegation\n * @param _delegatee Address of the delegatee\n * @param _lockDuration Duration of time for which the delegation is locked. Must be less than the max duration.\n * @return Returns the address of the Delegation contract that will hold the tickets\n */\n function createDelegation(\n address _delegator,\n uint256 _slot,\n address _delegatee,\n uint96 _lockDuration\n ) external returns (Delegation) {\n _requireDelegatorOrRepresentative(_delegator);\n _requireDelegateeNotZeroAddress(_delegatee);\n _requireLockDuration(_lockDuration);\n\n uint96 _lockUntil = _computeLockUntil(_lockDuration);\n\n Delegation _delegation = _createDelegation(\n _computeSalt(_delegator, bytes32(_slot)),\n _lockUntil\n );\n\n _setDelegateeCall(_delegation, _delegatee);\n\n emit DelegationCreated(_delegator, _slot, _lockUntil, _delegatee, _delegation, msg.sender);\n\n return _delegation;\n }\n\n /**\n * @notice Updates the delegatee and lock duration for a delegation slot.\n * @dev Only callable by the `_delegator` or their representative.\n * @dev Will revert if delegation is still locked.\n * @param _delegator Address of the delegator\n * @param _slot Slot of the delegation\n * @param _delegatee Address of the delegatee\n * @param _lockDuration Duration of time during which the delegatee cannot be changed nor withdrawn\n * @return The address of the Delegation\n */\n function updateDelegatee(\n address _delegator,\n uint256 _slot,\n address _delegatee,\n uint96 _lockDuration\n ) external returns (Delegation) {\n _requireDelegatorOrRepresentative(_delegator);\n _requireDelegateeNotZeroAddress(_delegatee);\n _requireLockDuration(_lockDuration);\n\n Delegation _delegation = Delegation(_computeAddress(_delegator, _slot));\n _requireDelegationUnlocked(_delegation);\n\n uint96 _lockUntil = _computeLockUntil(_lockDuration);\n\n if (_lockDuration > 0) {\n _delegation.setLockUntil(_lockUntil);\n }\n\n _setDelegateeCall(_delegation, _delegatee);\n\n emit DelegateeUpdated(_delegator, _slot, _delegatee, _lockUntil, msg.sender);\n\n return _delegation;\n }\n\n /**\n * @notice Fund a delegation by transferring tickets from the caller to the delegation.\n * @dev Callable by anyone.\n * @dev Will revert if delegation does not exist.\n * @param _delegator Address of the delegator\n * @param _slot Slot of the delegation\n * @param _amount Amount of tickets to transfer\n * @return The address of the Delegation\n */\n function fundDelegation(\n address _delegator,\n uint256 _slot,\n uint256 _amount\n ) external returns (Delegation) {\n require(_delegator != address(0), \"TWABDelegator/dlgtr-not-zero-adr\");\n _requireAmountGtZero(_amount);\n\n Delegation _delegation = Delegation(_computeAddress(_delegator, _slot));\n IERC20(ticket).safeTransferFrom(msg.sender, address(_delegation), _amount);\n\n emit DelegationFunded(_delegator, _slot, _amount, msg.sender);\n\n return _delegation;\n }\n\n /**\n * @notice Fund a delegation using the `_delegator` stake.\n * @dev Callable only by the `_delegator` or a representative.\n * @dev Will revert if delegation does not exist.\n * @dev Will revert if `_amount` is greater than the staked amount.\n * @param _delegator Address of the delegator\n * @param _slot Slot of the delegation\n * @param _amount Amount of tickets to send to the delegation from the staked amount\n * @return The address of the Delegation\n */\n function fundDelegationFromStake(\n address _delegator,\n uint256 _slot,\n uint256 _amount\n ) external returns (Delegation) {\n _requireDelegatorOrRepresentative(_delegator);\n _requireAmountGtZero(_amount);\n\n Delegation _delegation = Delegation(_computeAddress(_delegator, _slot));\n\n _burn(_delegator, _amount);\n\n IERC20(ticket).safeTransfer(address(_delegation), _amount);\n\n emit DelegationFundedFromStake(_delegator, _slot, _amount, msg.sender);\n\n return _delegation;\n }\n\n /**\n * @notice Withdraw tickets from a delegation. The tickets will be held by this contract and the delegator's stake will increase.\n * @dev Only callable by the `_delegator` or a representative.\n * @dev Will send the tickets to this contract and increase the `_delegator` staked amount.\n * @dev Will revert if delegation is still locked.\n * @param _delegator Address of the delegator\n * @param _slot Slot of the delegation\n * @param _amount Amount of tickets to withdraw\n * @return The address of the Delegation\n */\n function withdrawDelegationToStake(\n address _delegator,\n uint256 _slot,\n uint256 _amount\n ) external returns (Delegation) {\n _requireDelegatorOrRepresentative(_delegator);\n\n Delegation _delegation = Delegation(_computeAddress(_delegator, _slot));\n\n _transfer(_delegation, address(this), _amount);\n\n _mint(_delegator, _amount);\n\n emit WithdrewDelegationToStake(_delegator, _slot, _amount, msg.sender);\n\n return _delegation;\n }\n\n /**\n * @notice Withdraw an `_amount` of tickets from a delegation. The delegator is assumed to be the caller.\n * @dev Tickets are sent directly to the passed `_to` address.\n * @dev Will revert if delegation is still locked.\n * @param _slot Slot of the delegation\n * @param _amount Amount to withdraw\n * @param _to Account to transfer the withdrawn tickets to\n * @return The address of the Delegation\n */\n function transferDelegationTo(\n uint256 _slot,\n uint256 _amount,\n address _to\n ) external returns (Delegation) {\n _requireRecipientNotZeroAddress(_to);\n\n Delegation _delegation = Delegation(_computeAddress(msg.sender, _slot));\n _transfer(_delegation, _to, _amount);\n\n emit TransferredDelegation(msg.sender, _slot, _amount, _to);\n\n return _delegation;\n }\n\n /**\n * @notice Allow an account to set or unset a `_representative` to handle delegation.\n * @dev If `_set` is `true`, `_representative` will be set as representative of `msg.sender`.\n * @dev If `_set` is `false`, `_representative` will be unset as representative of `msg.sender`.\n * @param _representative Address of the representative\n * @param _set Set or unset the representative\n */\n function setRepresentative(address _representative, bool _set) external {\n require(_representative != address(0), \"TWABDelegator/rep-not-zero-addr\");\n\n representatives[msg.sender][_representative] = _set;\n\n emit RepresentativeSet(msg.sender, _representative, _set);\n }\n\n /**\n * @notice Returns whether or not the given rep is a representative of the delegator.\n * @param _delegator The delegator\n * @param _representative The representative to check for\n * @return True if the rep is a rep, false otherwise\n */\n function isRepresentativeOf(address _delegator, address _representative)\n external\n view\n returns (bool)\n {\n return representatives[_delegator][_representative];\n }\n\n /**\n * @notice Allows a user to call multiple functions on the same contract. Useful for EOA who wants to batch transactions.\n * @param _data An array of encoded function calls. The calls must be abi-encoded calls to this contract.\n * @return The results from each function call\n */\n function multicall(bytes[] calldata _data) external returns (bytes[] memory) {\n return _multicall(_data);\n }\n\n /**\n * @notice Alow a user to approve ticket and run various calls in one transaction.\n * @param _amount Amount of tickets to approve\n * @param _permitSignature Permit signature\n * @param _data Datas to call with `functionDelegateCall`\n */\n function permitAndMulticall(\n uint256 _amount,\n Signature calldata _permitSignature,\n bytes[] calldata _data\n ) external {\n _permitAndMulticall(IERC20Permit(address(ticket)), _amount, _permitSignature, _data);\n }\n\n /**\n * @notice Allows the caller to easily get the details for a delegation.\n * @param _delegator The delegator address\n * @param _slot The delegation slot they are using\n * @return delegation The address that holds tickets for the delegation\n * @return delegatee The address that tickets are being delegated to\n * @return balance The balance of tickets in the delegation\n * @return lockUntil The timestamp at which the delegation unlocks\n * @return wasCreated Whether or not the delegation has been created\n */\n function getDelegation(address _delegator, uint256 _slot)\n external\n view\n returns (\n Delegation delegation,\n address delegatee,\n uint256 balance,\n uint256 lockUntil,\n bool wasCreated\n )\n {\n delegation = Delegation(_computeAddress(_delegator, _slot));\n wasCreated = address(delegation).isContract();\n delegatee = ticket.delegateOf(address(delegation));\n balance = ticket.balanceOf(address(delegation));\n\n if (wasCreated) {\n lockUntil = delegation.lockUntil();\n }\n }\n\n /**\n * @notice Computes the address of the delegation for the delegator + slot combination.\n * @param _delegator The user who is delegating tickets\n * @param _slot The delegation slot\n * @return The address of the delegation. This is the address that holds the balance of tickets.\n */\n function computeDelegationAddress(address _delegator, uint256 _slot)\n external\n view\n returns (address)\n {\n return _computeAddress(_delegator, _slot);\n }\n\n /**\n * @notice Returns the ERC20 token decimals.\n * @dev This value is equal to the decimals of the ticket being delegated.\n * @return ERC20 token decimals\n */\n function decimals() public view virtual override returns (uint8) {\n return ERC20(address(ticket)).decimals();\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Computes the address of a delegation contract using the delegator and slot as a salt.\n The contract is a clone, also known as minimal proxy contract.\n * @param _delegator Address of the delegator\n * @param _slot Slot of the delegation\n * @return Address at which the delegation contract will be deployed\n */\n function _computeAddress(address _delegator, uint256 _slot) internal view returns (address) {\n return _computeAddress(_computeSalt(_delegator, bytes32(_slot)));\n }\n\n /**\n * @notice Computes the timestamp at which the delegation unlocks, after which the delegatee can be changed and tickets withdrawn.\n * @param _lockDuration The duration of the lock\n * @return The lock expiration timestamp\n */\n function _computeLockUntil(uint96 _lockDuration) internal view returns (uint96) {\n unchecked {\n return uint96(block.timestamp) + _lockDuration;\n }\n }\n\n /**\n * @notice Delegates tickets from the `_delegation` contract to the `_delegatee` address.\n * @param _delegation Address of the delegation contract\n * @param _delegatee Address of the delegatee\n */\n function _setDelegateeCall(Delegation _delegation, address _delegatee) internal {\n bytes4 _selector = ticket.delegate.selector;\n bytes memory _data = abi.encodeWithSelector(_selector, _delegatee);\n\n _executeCall(_delegation, _data);\n }\n\n /**\n * @notice Tranfers tickets from the Delegation contract to the `_to` address.\n * @param _delegation Address of the delegation contract\n * @param _to Address of the recipient\n * @param _amount Amount of tickets to transfer\n */\n function _transferCall(\n Delegation _delegation,\n address _to,\n uint256 _amount\n ) internal {\n bytes4 _selector = ticket.transfer.selector;\n bytes memory _data = abi.encodeWithSelector(_selector, _to, _amount);\n\n _executeCall(_delegation, _data);\n }\n\n /**\n * @notice Execute a function call on the delegation contract.\n * @param _delegation Address of the delegation contract\n * @param _data The call data that will be executed\n * @return The return datas from the calls\n */\n function _executeCall(Delegation _delegation, bytes memory _data)\n internal\n returns (bytes[] memory)\n {\n Delegation.Call[] memory _calls = new Delegation.Call[](1);\n _calls[0] = Delegation.Call({ to: address(ticket), data: _data });\n\n return _delegation.executeCalls(_calls);\n }\n\n /**\n * @notice Transfers tickets from a delegation contract to `_to`.\n * @param _delegation Address of the delegation contract\n * @param _to Address of the recipient\n * @param _amount Amount of tickets to transfer\n */\n function _transfer(\n Delegation _delegation,\n address _to,\n uint256 _amount\n ) internal {\n _requireAmountGtZero(_amount);\n _requireDelegationUnlocked(_delegation);\n\n _transferCall(_delegation, _to, _amount);\n }\n\n /* ============ Modifier/Require Functions ============ */\n\n /**\n * @notice Require to only allow the delegator or representative to call a function.\n * @param _delegator Address of the delegator\n */\n function _requireDelegatorOrRepresentative(address _delegator) internal view {\n require(\n _delegator == msg.sender || representatives[_delegator][msg.sender],\n \"TWABDelegator/not-dlgtr-or-rep\"\n );\n }\n\n /**\n * @notice Require to verify that `_delegatee` is not address zero.\n * @param _delegatee Address of the delegatee\n */\n function _requireDelegateeNotZeroAddress(address _delegatee) internal pure {\n require(_delegatee != address(0), \"TWABDelegator/dlgt-not-zero-addr\");\n }\n\n /**\n * @notice Require to verify that `_amount` is greater than 0.\n * @param _amount Amount to check\n */\n function _requireAmountGtZero(uint256 _amount) internal pure {\n require(_amount > 0, \"TWABDelegator/amount-gt-zero\");\n }\n\n /**\n * @notice Require to verify that `_to` is not address zero.\n * @param _to Address to check\n */\n function _requireRecipientNotZeroAddress(address _to) internal pure {\n require(_to != address(0), \"TWABDelegator/to-not-zero-addr\");\n }\n\n /**\n * @notice Require to verify if a `_delegation` is locked.\n * @param _delegation Delegation to check\n */\n function _requireDelegationUnlocked(Delegation _delegation) internal view {\n require(block.timestamp >= _delegation.lockUntil(), \"TWABDelegator/delegation-locked\");\n }\n\n /**\n * @notice Require to verify that a `_lockDuration` does not exceed the maximum lock duration.\n * @param _lockDuration Lock duration to check\n */\n function _requireLockDuration(uint256 _lockDuration) internal pure {\n require(_lockDuration <= MAX_LOCK, \"TWABDelegator/lock-too-long\");\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Clones.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/Clones.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for\n * deploying minimal proxy contracts, also known as \"clones\".\n *\n * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies\n * > a minimal bytecode implementation that delegates all calls to a known, fixed address.\n *\n * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`\n * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the\n * deterministic method.\n *\n * _Available since v3.4._\n */\nlibrary Clones {\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create opcode, which should never revert.\n */\n function clone(address implementation) internal returns (address instance) {\n assembly {\n let ptr := mload(0x40)\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)\n mstore(add(ptr, 0x14), shl(0x60, implementation))\n mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)\n instance := create(0, ptr, 0x37)\n }\n require(instance != address(0), \"ERC1167: create failed\");\n }\n\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create2 opcode and a `salt` to deterministically deploy\n * the clone. Using the same `implementation` and `salt` multiple time will revert, since\n * the clones cannot be deployed twice at the same address.\n */\n function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {\n assembly {\n let ptr := mload(0x40)\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)\n mstore(add(ptr, 0x14), shl(0x60, implementation))\n mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)\n instance := create2(0, ptr, 0x37, salt)\n }\n require(instance != address(0), \"ERC1167: create2 failed\");\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(\n address implementation,\n bytes32 salt,\n address deployer\n ) internal pure returns (address predicted) {\n assembly {\n let ptr := mload(0x40)\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)\n mstore(add(ptr, 0x14), shl(0x60, implementation))\n mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000)\n mstore(add(ptr, 0x38), shl(0x60, deployer))\n mstore(add(ptr, 0x4c), salt)\n mstore(add(ptr, 0x6c), keccak256(ptr, 0x37))\n predicted := keccak256(add(ptr, 0x37), 0x55)\n }\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(address implementation, bytes32 salt)\n internal\n view\n returns (address predicted)\n {\n return predictDeterministicAddress(implementation, salt, address(this));\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `sender` to `recipient`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n\n _afterTokenTransfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@pooltogether/v4-twab-delegator/contracts/Delegation.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\n/**\n * @title Contract instantiated via CREATE2 to handle a Delegation by a delegator to a delegatee.\n * @notice A Delegation allows his owner to execute calls on behalf of the contract.\n * @dev This contract is intended to be counterfactually instantiated via CREATE2 through the LowLevelDelegator contract.\n * @dev This contract will hold tickets that will be delegated to a chosen delegatee.\n */\ncontract Delegation {\n /**\n * @notice A structure to define arbitrary contract calls.\n * @param to The address to call\n * @param data The call data\n */\n struct Call {\n address to;\n bytes data;\n }\n\n /// @notice Contract owner.\n address private _owner;\n\n /// @notice Timestamp until which the delegation is locked.\n uint96 public lockUntil;\n\n /**\n * @notice Initializes the delegation.\n * @param _lockUntil Timestamp until which the delegation is locked\n */\n function initialize(uint96 _lockUntil) external {\n require(_owner == address(0), \"Delegation/already-init\");\n _owner = msg.sender;\n lockUntil = _lockUntil;\n }\n\n /**\n * @notice Executes calls on behalf of this contract.\n * @param calls The array of calls to be executed\n * @return An array of the return values for each of the calls\n */\n function executeCalls(Call[] calldata calls) external onlyOwner returns (bytes[] memory) {\n uint256 _callsLength = calls.length;\n bytes[] memory response = new bytes[](_callsLength);\n Call memory call;\n\n for (uint256 i; i < _callsLength; i++) {\n call = calls[i];\n response[i] = _executeCall(call.to, call.data);\n }\n\n return response;\n }\n\n /**\n * @notice Set the timestamp until which the delegation is locked.\n * @param _lockUntil The timestamp until which the delegation is locked\n */\n function setLockUntil(uint96 _lockUntil) external onlyOwner {\n lockUntil = _lockUntil;\n }\n\n /**\n * @notice Executes a call to another contract.\n * @param to The address to call\n * @param data The call data\n * @return The return data from the call\n */\n function _executeCall(address to, bytes memory data) internal returns (bytes memory) {\n (bool succeeded, bytes memory returnValue) = to.call{ value: 0 }(data);\n require(succeeded, string(returnValue));\n return returnValue;\n }\n\n /// @notice Modifier to only allow the contract owner to call a function\n modifier onlyOwner() {\n require(msg.sender == _owner, \"Delegation/only-owner\");\n _;\n }\n}\n" + }, + "@pooltogether/v4-twab-delegator/contracts/LowLevelDelegator.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/proxy/Clones.sol\";\n\nimport \"./Delegation.sol\";\n\n/// @title The LowLevelDelegator allows users to create delegations very cheaply.\ncontract LowLevelDelegator {\n using Clones for address;\n\n /// @notice The instance to which all proxies will point.\n Delegation public delegationInstance;\n\n /// @notice Contract constructor.\n constructor() {\n delegationInstance = new Delegation();\n delegationInstance.initialize(uint96(0));\n }\n\n /**\n * @notice Creates a clone of the delegation.\n * @param _salt Random number used to deterministically deploy the clone\n * @param _lockUntil Timestamp until which the delegation is locked\n * @return The newly created delegation\n */\n function _createDelegation(bytes32 _salt, uint96 _lockUntil) internal returns (Delegation) {\n Delegation _delegation = Delegation(address(delegationInstance).cloneDeterministic(_salt));\n _delegation.initialize(_lockUntil);\n return _delegation;\n }\n\n /**\n * @notice Computes the address of a clone, also known as minimal proxy contract.\n * @param _salt Random number used to compute the address\n * @return Address at which the clone will be deployed\n */\n function _computeAddress(bytes32 _salt) internal view returns (address) {\n return address(delegationInstance).predictDeterministicAddress(_salt, address(this));\n }\n\n /**\n * @notice Computes salt used to deterministically deploy a clone.\n * @param _delegator Address of the delegator\n * @param _slot Slot of the delegation\n * @return Salt used to deterministically deploy a clone.\n */\n function _computeSalt(address _delegator, bytes32 _slot) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(_delegator, _slot));\n }\n}\n" + }, + "@pooltogether/v4-twab-delegator/contracts/PermitAndMulticall.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @notice Allows a user to permit token spend and then call multiple functions on a contract.\n */\ncontract PermitAndMulticall {\n /**\n * @notice Secp256k1 signature values.\n * @param deadline Timestamp at which the signature expires\n * @param v `v` portion of the signature\n * @param r `r` portion of the signature\n * @param s `s` portion of the signature\n */\n struct Signature {\n uint256 deadline;\n uint8 v;\n bytes32 r;\n bytes32 s;\n }\n\n /**\n * @notice Allows a user to call multiple functions on the same contract. Useful for EOA who want to batch transactions.\n * @param _data An array of encoded function calls. The calls must be abi-encoded calls to this contract.\n * @return The results from each function call\n */\n function _multicall(bytes[] calldata _data) internal virtual returns (bytes[] memory) {\n uint256 _dataLength = _data.length;\n bytes[] memory results = new bytes[](_dataLength);\n\n for (uint256 i; i < _dataLength; i++) {\n results[i] = Address.functionDelegateCall(address(this), _data[i]);\n }\n\n return results;\n }\n\n /**\n * @notice Allow a user to approve an ERC20 token and run various calls in one transaction.\n * @param _permitToken Address of the ERC20 token\n * @param _amount Amount of tickets to approve\n * @param _permitSignature Permit signature\n * @param _data Datas to call with `functionDelegateCall`\n */\n function _permitAndMulticall(\n IERC20Permit _permitToken,\n uint256 _amount,\n Signature calldata _permitSignature,\n bytes[] calldata _data\n ) internal {\n _permitToken.permit(\n msg.sender,\n address(this),\n _amount,\n _permitSignature.deadline,\n _permitSignature.v,\n _permitSignature.r,\n _permitSignature.s\n );\n\n _multicall(_data);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@pooltogether/v4-core/contracts/prize-pool/YieldSourcePrizePool.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@pooltogether/yield-source-interface/contracts/IYieldSource.sol\";\n\nimport \"./PrizePool.sol\";\n\n/**\n * @title PoolTogether V4 YieldSourcePrizePool\n * @author PoolTogether Inc Team\n * @notice The Yield Source Prize Pool uses a yield source contract to generate prizes.\n * Funds that are deposited into the prize pool are then deposited into a yield source. (i.e. Aave, Compound, etc...)\n */\ncontract YieldSourcePrizePool is PrizePool {\n using SafeERC20 for IERC20;\n using Address for address;\n\n /// @notice Address of the yield source.\n IYieldSource public immutable yieldSource;\n\n /// @dev Emitted when yield source prize pool is deployed.\n /// @param yieldSource Address of the yield source.\n event Deployed(address indexed yieldSource);\n\n /// @notice Emitted when stray deposit token balance in this contract is swept\n /// @param amount The amount that was swept\n event Swept(uint256 amount);\n\n /// @notice Deploy the Prize Pool and Yield Service with the required contract connections\n /// @param _owner Address of the Yield Source Prize Pool owner\n /// @param _yieldSource Address of the yield source\n constructor(address _owner, IYieldSource _yieldSource) PrizePool(_owner) {\n require(\n address(_yieldSource) != address(0),\n \"YieldSourcePrizePool/yield-source-not-zero-address\"\n );\n\n yieldSource = _yieldSource;\n\n // A hack to determine whether it's an actual yield source\n (bool succeeded, bytes memory data) = address(_yieldSource).staticcall(\n abi.encodePacked(_yieldSource.depositToken.selector)\n );\n address resultingAddress;\n if (data.length > 0) {\n resultingAddress = abi.decode(data, (address));\n }\n require(succeeded && resultingAddress != address(0), \"YieldSourcePrizePool/invalid-yield-source\");\n\n emit Deployed(address(_yieldSource));\n }\n\n /// @notice Sweeps any stray balance of deposit tokens into the yield source.\n /// @dev This becomes prize money\n function sweep() external nonReentrant onlyOwner {\n uint256 balance = _token().balanceOf(address(this));\n _supply(balance);\n\n emit Swept(balance);\n }\n\n /// @notice Determines whether the passed token can be transferred out as an external award.\n /// @dev Different yield sources will hold the deposits as another kind of token: such a Compound's cToken. The\n /// prize strategy should not be allowed to move those tokens.\n /// @param _externalToken The address of the token to check\n /// @return True if the token may be awarded, false otherwise\n function _canAwardExternal(address _externalToken) internal view override returns (bool) {\n IYieldSource _yieldSource = yieldSource;\n return (\n _externalToken != address(_yieldSource) &&\n _externalToken != _yieldSource.depositToken()\n );\n }\n\n /// @notice Returns the total balance (in asset tokens). This includes the deposits and interest.\n /// @return The underlying balance of asset tokens\n function _balance() internal override returns (uint256) {\n return yieldSource.balanceOfToken(address(this));\n }\n\n /// @notice Returns the address of the ERC20 asset token used for deposits.\n /// @return Address of the ERC20 asset token.\n function _token() internal view override returns (IERC20) {\n return IERC20(yieldSource.depositToken());\n }\n\n /// @notice Supplies asset tokens to the yield source.\n /// @param _mintAmount The amount of asset tokens to be supplied\n function _supply(uint256 _mintAmount) internal override {\n _token().safeIncreaseAllowance(address(yieldSource), _mintAmount);\n yieldSource.supplyTokenTo(_mintAmount, address(this));\n }\n\n /// @notice Redeems asset tokens from the yield source.\n /// @param _redeemAmount The amount of yield-bearing tokens to be redeemed\n /// @return The actual amount of tokens that were redeemed.\n function _redeem(uint256 _redeemAmount) internal override returns (uint256) {\n return yieldSource.redeemToken(_redeemAmount);\n }\n}\n" + }, + "@pooltogether/yield-source-interface/contracts/IYieldSource.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.6.0;\n\n/// @title Defines the functions used to interact with a yield source. The Prize Pool inherits this contract.\n/// @notice Prize Pools subclasses need to implement this interface so that yield can be generated.\ninterface IYieldSource {\n /// @notice Returns the ERC20 asset token used for deposits.\n /// @return The ERC20 asset token address.\n function depositToken() external view returns (address);\n\n /// @notice Returns the total balance (in asset tokens). This includes the deposits and interest.\n /// @return The underlying balance of asset tokens.\n function balanceOfToken(address addr) external returns (uint256);\n\n /// @notice Supplies tokens to the yield source. Allows assets to be supplied on other user's behalf using the `to` param.\n /// @param amount The amount of asset tokens to be supplied. Denominated in `depositToken()` as above.\n /// @param to The user whose balance will receive the tokens\n function supplyTokenTo(uint256 amount, address to) external;\n\n /// @notice Redeems tokens from the yield source.\n /// @param amount The amount of asset tokens to withdraw. Denominated in `depositToken()` as above.\n /// @return The actual amount of interst bearing tokens that were redeemed.\n function redeemToken(uint256 amount) external returns (uint256);\n}\n" + }, + "@pooltogether/aave-yield-source/contracts/external/aave/IProtocolYieldSource.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@pooltogether/yield-source-interface/contracts/IYieldSource.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/// @title The interface used for all Yield Sources for the PoolTogether protocol\n/// @dev There are two privileged roles: the owner and the asset manager. The owner can configure the asset managers.\ninterface IProtocolYieldSource is IYieldSource {\n /// @notice Allows the owner to transfer ERC20 tokens held by this contract to the target address.\n /// @dev This function is callable by the owner or asset manager.\n /// This function should not be able to transfer any tokens that represent user deposits.\n /// @param token The ERC20 token to transfer\n /// @param to The recipient of the tokens\n /// @param amount The amount of tokens to transfer\n function transferERC20(IERC20 token, address to, uint256 amount) external;\n\n /// @notice Allows someone to deposit into the yield source without receiving any shares. The deposited token will be the same as token()\n /// This allows anyone to distribute tokens among the share holders.\n function sponsor(uint256 amount) external;\n}\n" + }, + "@pooltogether/v4-core/contracts/Ticket.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\nimport \"./libraries/ExtendedSafeCastLib.sol\";\nimport \"./libraries/TwabLib.sol\";\nimport \"./interfaces/ITicket.sol\";\nimport \"./ControlledToken.sol\";\n\n/**\n * @title PoolTogether V4 Ticket\n * @author PoolTogether Inc Team\n * @notice The Ticket extends the standard ERC20 and ControlledToken interfaces with time-weighted average balance functionality.\n The average balance held by a user between two timestamps can be calculated, as well as the historic balance. The\n historic total supply is available as well as the average total supply between two timestamps.\n\n A user may \"delegate\" their balance; increasing another user's historic balance while retaining their tokens.\n*/\ncontract Ticket is ControlledToken, ITicket {\n using SafeERC20 for IERC20;\n using ExtendedSafeCastLib for uint256;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private immutable _DELEGATE_TYPEHASH =\n keccak256(\"Delegate(address user,address delegate,uint256 nonce,uint256 deadline)\");\n\n /// @notice Record of token holders TWABs for each account.\n mapping(address => TwabLib.Account) internal userTwabs;\n\n /// @notice Record of tickets total supply and ring buff parameters used for observation.\n TwabLib.Account internal totalSupplyTwab;\n\n /// @notice Mapping of delegates. Each address can delegate their ticket power to another.\n mapping(address => address) internal delegates;\n\n /* ============ Constructor ============ */\n\n /**\n * @notice Constructs Ticket with passed parameters.\n * @param _name ERC20 ticket token name.\n * @param _symbol ERC20 ticket token symbol.\n * @param decimals_ ERC20 ticket token decimals.\n * @param _controller ERC20 ticket controller address (ie: Prize Pool address).\n */\n constructor(\n string memory _name,\n string memory _symbol,\n uint8 decimals_,\n address _controller\n ) ControlledToken(_name, _symbol, decimals_, _controller) {}\n\n /* ============ External Functions ============ */\n\n /// @inheritdoc ITicket\n function getAccountDetails(address _user)\n external\n view\n override\n returns (TwabLib.AccountDetails memory)\n {\n return userTwabs[_user].details;\n }\n\n /// @inheritdoc ITicket\n function getTwab(address _user, uint16 _index)\n external\n view\n override\n returns (ObservationLib.Observation memory)\n {\n return userTwabs[_user].twabs[_index];\n }\n\n /// @inheritdoc ITicket\n function getBalanceAt(address _user, uint64 _target) external view override returns (uint256) {\n TwabLib.Account storage account = userTwabs[_user];\n\n return\n TwabLib.getBalanceAt(\n account.twabs,\n account.details,\n uint32(_target),\n uint32(block.timestamp)\n );\n }\n\n /// @inheritdoc ITicket\n function getAverageBalancesBetween(\n address _user,\n uint64[] calldata _startTimes,\n uint64[] calldata _endTimes\n ) external view override returns (uint256[] memory) {\n return _getAverageBalancesBetween(userTwabs[_user], _startTimes, _endTimes);\n }\n\n /// @inheritdoc ITicket\n function getAverageTotalSuppliesBetween(\n uint64[] calldata _startTimes,\n uint64[] calldata _endTimes\n ) external view override returns (uint256[] memory) {\n return _getAverageBalancesBetween(totalSupplyTwab, _startTimes, _endTimes);\n }\n\n /// @inheritdoc ITicket\n function getAverageBalanceBetween(\n address _user,\n uint64 _startTime,\n uint64 _endTime\n ) external view override returns (uint256) {\n TwabLib.Account storage account = userTwabs[_user];\n\n return\n TwabLib.getAverageBalanceBetween(\n account.twabs,\n account.details,\n uint32(_startTime),\n uint32(_endTime),\n uint32(block.timestamp)\n );\n }\n\n /// @inheritdoc ITicket\n function getBalancesAt(address _user, uint64[] calldata _targets)\n external\n view\n override\n returns (uint256[] memory)\n {\n uint256 length = _targets.length;\n uint256[] memory _balances = new uint256[](length);\n\n TwabLib.Account storage twabContext = userTwabs[_user];\n TwabLib.AccountDetails memory details = twabContext.details;\n\n for (uint256 i = 0; i < length; i++) {\n _balances[i] = TwabLib.getBalanceAt(\n twabContext.twabs,\n details,\n uint32(_targets[i]),\n uint32(block.timestamp)\n );\n }\n\n return _balances;\n }\n\n /// @inheritdoc ITicket\n function getTotalSupplyAt(uint64 _target) external view override returns (uint256) {\n return\n TwabLib.getBalanceAt(\n totalSupplyTwab.twabs,\n totalSupplyTwab.details,\n uint32(_target),\n uint32(block.timestamp)\n );\n }\n\n /// @inheritdoc ITicket\n function getTotalSuppliesAt(uint64[] calldata _targets)\n external\n view\n override\n returns (uint256[] memory)\n {\n uint256 length = _targets.length;\n uint256[] memory totalSupplies = new uint256[](length);\n\n TwabLib.AccountDetails memory details = totalSupplyTwab.details;\n\n for (uint256 i = 0; i < length; i++) {\n totalSupplies[i] = TwabLib.getBalanceAt(\n totalSupplyTwab.twabs,\n details,\n uint32(_targets[i]),\n uint32(block.timestamp)\n );\n }\n\n return totalSupplies;\n }\n\n /// @inheritdoc ITicket\n function delegateOf(address _user) external view override returns (address) {\n return delegates[_user];\n }\n\n /// @inheritdoc ITicket\n function controllerDelegateFor(address _user, address _to) external override onlyController {\n _delegate(_user, _to);\n }\n\n /// @inheritdoc ITicket\n function delegateWithSignature(\n address _user,\n address _newDelegate,\n uint256 _deadline,\n uint8 _v,\n bytes32 _r,\n bytes32 _s\n ) external virtual override {\n require(block.timestamp <= _deadline, \"Ticket/delegate-expired-deadline\");\n\n bytes32 structHash = keccak256(abi.encode(_DELEGATE_TYPEHASH, _user, _newDelegate, _useNonce(_user), _deadline));\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, _v, _r, _s);\n require(signer == _user, \"Ticket/delegate-invalid-signature\");\n\n _delegate(_user, _newDelegate);\n }\n\n /// @inheritdoc ITicket\n function delegate(address _to) external virtual override {\n _delegate(msg.sender, _to);\n }\n\n /// @notice Delegates a users chance to another\n /// @param _user The user whose balance should be delegated\n /// @param _to The delegate\n function _delegate(address _user, address _to) internal {\n uint256 balance = balanceOf(_user);\n address currentDelegate = delegates[_user];\n\n if (currentDelegate == _to) {\n return;\n }\n\n delegates[_user] = _to;\n\n _transferTwab(currentDelegate, _to, balance);\n\n emit Delegated(_user, _to);\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Retrieves the average balances held by a user for a given time frame.\n * @param _account The user whose balance is checked.\n * @param _startTimes The start time of the time frame.\n * @param _endTimes The end time of the time frame.\n * @return The average balance that the user held during the time frame.\n */\n function _getAverageBalancesBetween(\n TwabLib.Account storage _account,\n uint64[] calldata _startTimes,\n uint64[] calldata _endTimes\n ) internal view returns (uint256[] memory) {\n uint256 startTimesLength = _startTimes.length;\n require(startTimesLength == _endTimes.length, \"Ticket/start-end-times-length-match\");\n\n TwabLib.AccountDetails memory accountDetails = _account.details;\n\n uint256[] memory averageBalances = new uint256[](startTimesLength);\n uint32 currentTimestamp = uint32(block.timestamp);\n\n for (uint256 i = 0; i < startTimesLength; i++) {\n averageBalances[i] = TwabLib.getAverageBalanceBetween(\n _account.twabs,\n accountDetails,\n uint32(_startTimes[i]),\n uint32(_endTimes[i]),\n currentTimestamp\n );\n }\n\n return averageBalances;\n }\n\n // @inheritdoc ERC20\n function _beforeTokenTransfer(address _from, address _to, uint256 _amount) internal override {\n if (_from == _to) {\n return;\n }\n\n address _fromDelegate;\n if (_from != address(0)) {\n _fromDelegate = delegates[_from];\n }\n\n address _toDelegate;\n if (_to != address(0)) {\n _toDelegate = delegates[_to];\n }\n\n _transferTwab(_fromDelegate, _toDelegate, _amount);\n }\n\n /// @notice Transfers the given TWAB balance from one user to another\n /// @param _from The user to transfer the balance from. May be zero in the event of a mint.\n /// @param _to The user to transfer the balance to. May be zero in the event of a burn.\n /// @param _amount The balance that is being transferred.\n function _transferTwab(address _from, address _to, uint256 _amount) internal {\n // If we are transferring tokens from a delegated account to an undelegated account\n if (_from != address(0)) {\n _decreaseUserTwab(_from, _amount);\n\n if (_to == address(0)) {\n _decreaseTotalSupplyTwab(_amount);\n }\n }\n\n // If we are transferring tokens from an undelegated account to a delegated account\n if (_to != address(0)) {\n _increaseUserTwab(_to, _amount);\n\n if (_from == address(0)) {\n _increaseTotalSupplyTwab(_amount);\n }\n }\n }\n\n /**\n * @notice Increase `_to` TWAB balance.\n * @param _to Address of the delegate.\n * @param _amount Amount of tokens to be added to `_to` TWAB balance.\n */\n function _increaseUserTwab(\n address _to,\n uint256 _amount\n ) internal {\n if (_amount == 0) {\n return;\n }\n\n TwabLib.Account storage _account = userTwabs[_to];\n\n (\n TwabLib.AccountDetails memory accountDetails,\n ObservationLib.Observation memory twab,\n bool isNew\n ) = TwabLib.increaseBalance(_account, _amount.toUint208(), uint32(block.timestamp));\n\n _account.details = accountDetails;\n\n if (isNew) {\n emit NewUserTwab(_to, twab);\n }\n }\n\n /**\n * @notice Decrease `_to` TWAB balance.\n * @param _to Address of the delegate.\n * @param _amount Amount of tokens to be added to `_to` TWAB balance.\n */\n function _decreaseUserTwab(\n address _to,\n uint256 _amount\n ) internal {\n if (_amount == 0) {\n return;\n }\n\n TwabLib.Account storage _account = userTwabs[_to];\n\n (\n TwabLib.AccountDetails memory accountDetails,\n ObservationLib.Observation memory twab,\n bool isNew\n ) = TwabLib.decreaseBalance(\n _account,\n _amount.toUint208(),\n \"Ticket/twab-burn-lt-balance\",\n uint32(block.timestamp)\n );\n\n _account.details = accountDetails;\n\n if (isNew) {\n emit NewUserTwab(_to, twab);\n }\n }\n\n /// @notice Decreases the total supply twab. Should be called anytime a balance moves from delegated to undelegated\n /// @param _amount The amount to decrease the total by\n function _decreaseTotalSupplyTwab(uint256 _amount) internal {\n if (_amount == 0) {\n return;\n }\n\n (\n TwabLib.AccountDetails memory accountDetails,\n ObservationLib.Observation memory tsTwab,\n bool tsIsNew\n ) = TwabLib.decreaseBalance(\n totalSupplyTwab,\n _amount.toUint208(),\n \"Ticket/burn-amount-exceeds-total-supply-twab\",\n uint32(block.timestamp)\n );\n\n totalSupplyTwab.details = accountDetails;\n\n if (tsIsNew) {\n emit NewTotalSupplyTwab(tsTwab);\n }\n }\n\n /// @notice Increases the total supply twab. Should be called anytime a balance moves from undelegated to delegated\n /// @param _amount The amount to increase the total by\n function _increaseTotalSupplyTwab(uint256 _amount) internal {\n if (_amount == 0) {\n return;\n }\n\n (\n TwabLib.AccountDetails memory accountDetails,\n ObservationLib.Observation memory _totalSupply,\n bool tsIsNew\n ) = TwabLib.increaseBalance(totalSupplyTwab, _amount.toUint208(), uint32(block.timestamp));\n\n totalSupplyTwab.details = accountDetails;\n\n if (tsIsNew) {\n emit NewTotalSupplyTwab(_totalSupply);\n }\n }\n}\n" + }, + "@pooltogether/v4-core/contracts/ControlledToken.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\";\n\nimport \"./interfaces/IControlledToken.sol\";\n\n/**\n * @title PoolTogether V4 Controlled ERC20 Token\n * @author PoolTogether Inc Team\n * @notice ERC20 Tokens with a controller for minting & burning\n */\ncontract ControlledToken is ERC20Permit, IControlledToken {\n /* ============ Global Variables ============ */\n\n /// @notice Interface to the contract responsible for controlling mint/burn\n address public override immutable controller;\n\n /// @notice ERC20 controlled token decimals.\n uint8 private immutable _decimals;\n\n /* ============ Events ============ */\n\n /// @dev Emitted when contract is deployed\n event Deployed(string name, string symbol, uint8 decimals, address indexed controller);\n\n /* ============ Modifiers ============ */\n\n /// @dev Function modifier to ensure that the caller is the controller contract\n modifier onlyController() {\n require(msg.sender == address(controller), \"ControlledToken/only-controller\");\n _;\n }\n\n /* ============ Constructor ============ */\n\n /// @notice Deploy the Controlled Token with Token Details and the Controller\n /// @param _name The name of the Token\n /// @param _symbol The symbol for the Token\n /// @param decimals_ The number of decimals for the Token\n /// @param _controller Address of the Controller contract for minting & burning\n constructor(\n string memory _name,\n string memory _symbol,\n uint8 decimals_,\n address _controller\n ) ERC20Permit(\"PoolTogether ControlledToken\") ERC20(_name, _symbol) {\n require(address(_controller) != address(0), \"ControlledToken/controller-not-zero-address\");\n controller = _controller;\n\n require(decimals_ > 0, \"ControlledToken/decimals-gt-zero\");\n _decimals = decimals_;\n\n emit Deployed(_name, _symbol, decimals_, _controller);\n }\n\n /* ============ External Functions ============ */\n\n /// @notice Allows the controller to mint tokens for a user account\n /// @dev May be overridden to provide more granular control over minting\n /// @param _user Address of the receiver of the minted tokens\n /// @param _amount Amount of tokens to mint\n function controllerMint(address _user, uint256 _amount)\n external\n virtual\n override\n onlyController\n {\n _mint(_user, _amount);\n }\n\n /// @notice Allows the controller to burn tokens from a user account\n /// @dev May be overridden to provide more granular control over burning\n /// @param _user Address of the holder account to burn tokens from\n /// @param _amount Amount of tokens to burn\n function controllerBurn(address _user, uint256 _amount)\n external\n virtual\n override\n onlyController\n {\n _burn(_user, _amount);\n }\n\n /// @notice Allows an operator via the controller to burn tokens on behalf of a user account\n /// @dev May be overridden to provide more granular control over operator-burning\n /// @param _operator Address of the operator performing the burn action via the controller contract\n /// @param _user Address of the holder account to burn tokens from\n /// @param _amount Amount of tokens to burn\n function controllerBurnFrom(\n address _operator,\n address _user,\n uint256 _amount\n ) external virtual override onlyController {\n if (_operator != _user) {\n _approve(_user, _operator, allowance(_user, _operator) - _amount);\n }\n\n _burn(_user, _amount);\n }\n\n /// @notice Returns the ERC20 controlled token decimals.\n /// @dev This value should be equal to the decimals of the token used to deposit into the pool.\n /// @return uint8 decimals.\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-ERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./draft-IERC20Permit.sol\";\nimport \"../ERC20.sol\";\nimport \"../../../utils/cryptography/draft-EIP712.sol\";\nimport \"../../../utils/cryptography/ECDSA.sol\";\nimport \"../../../utils/Counters.sol\";\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private immutable _PERMIT_TYPEHASH =\n keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"1\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(address owner) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(address owner) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n}\n" + }, + "@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 ÷ 2 + 1, and for v in (302): v ∈ {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" + }, + "@openzeppelin/contracts/utils/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\n }\n}\n" + }, + "@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" + }, + "@pooltogether/aave-yield-source/contracts/yield-source/ATokenYieldSource.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/security/ReentrancyGuard.sol\";\nimport \"@pooltogether/fixed-point/contracts/FixedPoint.sol\";\nimport \"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\";\n\nimport \"../external/aave/ILendingPool.sol\";\nimport \"../external/aave/ILendingPoolAddressesProvider.sol\";\nimport \"../external/aave/ILendingPoolAddressesProviderRegistry.sol\";\nimport \"../external/aave/ATokenInterface.sol\";\nimport \"../external/aave/IAaveIncentivesController.sol\";\nimport \"../external/aave/IProtocolYieldSource.sol\";\n\n/// @title Aave Yield Source integration contract, implementing PoolTogether's generic yield source interface\n/// @dev This contract inherits from the ERC20 implementation to keep track of users deposits\n/// @dev This contract inherits AssetManager which extends OwnableUpgradable\n/// @notice Yield source for a PoolTogether prize pool that generates yield by depositing into Aave V2\ncontract ATokenYieldSource is ERC20, IProtocolYieldSource, Manageable, ReentrancyGuard {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n /// @notice Emitted when the yield source is initialized\n event ATokenYieldSourceInitialized(\n IAToken indexed aToken,\n ILendingPoolAddressesProviderRegistry lendingPoolAddressesProviderRegistry,\n uint8 decimals,\n string name,\n string symbol,\n address owner\n );\n\n /// @notice Emitted when asset tokens are redeemed from the yield source\n event RedeemedToken(\n address indexed from,\n uint256 shares,\n uint256 amount\n );\n\n /// @notice Emitted when Aave rewards have been claimed\n event Claimed(\n address indexed user,\n address indexed to,\n uint256 amount\n );\n\n /// @notice Emitted when asset tokens are supplied to the yield source\n event SuppliedTokenTo(\n address indexed from,\n uint256 shares,\n uint256 amount,\n address indexed to\n );\n\n /// @notice Emitted when asset tokens are supplied to sponsor the yield source\n event Sponsored(\n address indexed from,\n uint256 amount\n );\n\n /// @notice Emitted when ERC20 tokens other than yield source's aToken are withdrawn from the yield source\n event TransferredERC20(\n address indexed from,\n address indexed to,\n uint256 amount,\n IERC20 indexed token\n );\n\n /// @notice Interface for the yield-bearing Aave aToken\n ATokenInterface public immutable aToken;\n\n /// @notice Interface for Aave incentivesController\n IAaveIncentivesController public immutable incentivesController;\n\n /// @notice Interface for Aave lendingPoolAddressesProviderRegistry\n ILendingPoolAddressesProviderRegistry public lendingPoolAddressesProviderRegistry;\n\n /// @notice Underlying asset token address.\n address private immutable _tokenAddress;\n\n /// @notice ERC20 token decimals.\n uint8 private immutable __decimals;\n\n /// @dev Aave genesis market LendingPoolAddressesProvider's ID\n /// @dev This variable could evolve in the future if we decide to support other markets\n uint256 private constant ADDRESSES_PROVIDER_ID = uint256(0);\n\n /// @dev PoolTogether's Aave Referral Code\n uint16 private constant REFERRAL_CODE = uint16(188);\n\n /// @notice Initializes the yield source with Aave aToken\n /// @param _aToken Aave aToken address\n /// @param _incentivesController Aave incentivesController address\n /// @param _lendingPoolAddressesProviderRegistry Aave lendingPoolAddressesProviderRegistry address\n /// @param _decimals Number of decimals the shares (inhereted ERC20) will have. Set as same as underlying asset to ensure sane ExchangeRates\n /// @param _symbol Token symbol for the underlying shares ERC20\n /// @param _name Token name for the underlying shares ERC20\n constructor (\n ATokenInterface _aToken,\n IAaveIncentivesController _incentivesController,\n ILendingPoolAddressesProviderRegistry _lendingPoolAddressesProviderRegistry,\n uint8 _decimals,\n string memory _symbol,\n string memory _name,\n address _owner\n ) Ownable(_owner) ERC20(_name, _symbol) ReentrancyGuard()\n {\n require(address(_aToken) != address(0), \"ATokenYieldSource/aToken-not-zero-address\");\n require(address(_incentivesController) != address(0), \"ATokenYieldSource/incentivesController-not-zero-address\");\n require(address(_lendingPoolAddressesProviderRegistry) != address(0), \"ATokenYieldSource/lendingPoolRegistry-not-zero-address\");\n require(_owner != address(0), \"ATokenYieldSource/owner-not-zero-address\");\n require(_decimals > 0, \"ATokenYieldSource/decimals-gt-zero\");\n\n aToken = _aToken;\n incentivesController = _incentivesController;\n lendingPoolAddressesProviderRegistry = _lendingPoolAddressesProviderRegistry;\n __decimals = _decimals;\n\n address tokenAddress = address(_aToken.UNDERLYING_ASSET_ADDRESS());\n _tokenAddress = tokenAddress;\n\n // Approve once for max amount\n IERC20(tokenAddress).safeApprove(address(_lendingPool()), type(uint256).max);\n\n emit ATokenYieldSourceInitialized (\n _aToken,\n _lendingPoolAddressesProviderRegistry,\n _decimals,\n _name,\n _symbol,\n _owner\n );\n }\n\n /// @notice Returns the number of decimals that the token repesenting yield source shares has\n /// @return The number of decimals\n function decimals() public override view returns (uint8) {\n return __decimals;\n }\n\n /// @notice Approve lending pool contract to spend max uint256 amount\n /// @dev Emergency function to re-approve max amount if approval amount dropped too low\n /// @return true if operation is successful\n function approveMaxAmount() external onlyOwner returns (bool) {\n address _lendingPoolAddress = address(_lendingPool());\n IERC20 _underlyingAsset = IERC20(_tokenAddress);\n\n _underlyingAsset.safeIncreaseAllowance(\n _lendingPoolAddress,\n type(uint256).max.sub(_underlyingAsset.allowance(address(this), _lendingPoolAddress))\n );\n\n return true;\n }\n\n /// @notice Returns the ERC20 asset token used for deposits\n /// @return The ERC20 asset token address\n function depositToken() public view override returns (address) {\n return _tokenAddress;\n }\n\n /// @notice Returns user total balance (in asset tokens). This includes the deposits and interest.\n /// @param addr User address\n /// @return The underlying balance of asset tokens\n function balanceOfToken(address addr) external override view returns (uint256) {\n return _sharesToToken(balanceOf(addr));\n }\n\n /// @notice Calculates the number of shares that should be mint or burned when a user deposit or withdraw\n /// @param _tokens Amount of tokens\n /// @return Number of shares\n function _tokenToShares(uint256 _tokens) internal view returns (uint256) {\n uint256 _shares;\n uint256 _totalSupply = totalSupply();\n\n if (_totalSupply == 0) {\n _shares = _tokens;\n } else {\n // rate = tokens / shares\n // shares = tokens * (totalShares / yieldSourceTotalSupply)\n uint256 _exchangeMantissa = FixedPoint.calculateMantissa(_totalSupply, aToken.balanceOf(address(this)));\n _shares = FixedPoint.multiplyUintByMantissa(_tokens, _exchangeMantissa);\n }\n\n return _shares;\n }\n\n /// @notice Calculates the number of tokens a user has in the yield source\n /// @param _shares Amount of shares\n /// @return Number of tokens\n function _sharesToToken(uint256 _shares) internal view returns (uint256) {\n uint256 _tokens;\n uint256 _totalSupply = totalSupply();\n\n if (_totalSupply == 0) {\n _tokens = _shares;\n } else {\n // tokens = (shares * yieldSourceTotalSupply) / totalShares\n _tokens = _shares.mul(aToken.balanceOf(address(this))).div(_totalSupply);\n }\n\n return _tokens;\n }\n\n /// @notice Checks that the amount of shares is greater than zero.\n /// @param _shares Amount of shares to check\n function _requireSharesGTZero(uint256 _shares) internal pure {\n require(_shares > 0, \"ATokenYieldSource/shares-gt-zero\");\n }\n\n /// @notice Deposit asset tokens to Aave\n /// @param mintAmount The amount of asset tokens to be deposited\n function _depositToAave(uint256 mintAmount) internal {\n IERC20(_tokenAddress).safeTransferFrom(msg.sender, address(this), mintAmount);\n _lendingPool().deposit(_tokenAddress, mintAmount, address(this), REFERRAL_CODE);\n }\n\n /// @notice Supplies asset tokens to the yield source\n /// @dev Shares corresponding to the number of tokens supplied are mint to the user's balance\n /// @dev Asset tokens are supplied to the yield source, then deposited into Aave\n /// @param mintAmount The amount of asset tokens to be supplied\n /// @param to The user whose balance will receive the tokens\n function supplyTokenTo(uint256 mintAmount, address to) external override nonReentrant {\n uint256 shares = _tokenToShares(mintAmount);\n _requireSharesGTZero(shares);\n\n _depositToAave(mintAmount);\n _mint(to, shares);\n\n emit SuppliedTokenTo(msg.sender, shares, mintAmount, to);\n }\n\n /// @notice Redeems asset tokens from the yield source\n /// @dev Shares corresponding to the number of tokens withdrawn are burnt from the user's balance\n /// @dev Asset tokens are withdrawn from Aave, then transferred from the yield source to the user's wallet\n /// @param redeemAmount The amount of asset tokens to be redeemed\n /// @return The actual amount of asset tokens that were redeemed\n function redeemToken(uint256 redeemAmount) external override nonReentrant returns (uint256) {\n uint256 shares = _tokenToShares(redeemAmount);\n _requireSharesGTZero(shares);\n\n _burn(msg.sender, shares);\n\n IERC20 _depositToken = IERC20(_tokenAddress);\n uint256 beforeBalance = _depositToken.balanceOf(address(this));\n _lendingPool().withdraw(_tokenAddress, redeemAmount, address(this));\n uint256 afterBalance = _depositToken.balanceOf(address(this));\n\n uint256 balanceDiff = afterBalance.sub(beforeBalance);\n _depositToken.safeTransfer(msg.sender, balanceDiff);\n\n emit RedeemedToken(msg.sender, shares, redeemAmount);\n return balanceDiff;\n }\n\n /// @notice Transfer ERC20 tokens other than the aTokens held by this contract to the recipient address\n /// @dev This function is only callable by the owner or asset manager\n /// @param erc20Token The ERC20 token to transfer\n /// @param to The recipient of the tokens\n /// @param amount The amount of tokens to transfer\n function transferERC20(IERC20 erc20Token, address to, uint256 amount) external override onlyManagerOrOwner {\n require(address(erc20Token) != address(aToken), \"ATokenYieldSource/aToken-transfer-not-allowed\");\n erc20Token.safeTransfer(to, amount);\n emit TransferredERC20(msg.sender, to, amount, erc20Token);\n }\n\n /// @notice Allows someone to deposit into the yield source without receiving any shares\n /// @dev This allows anyone to distribute tokens among the share holders\n /// @param amount The amount of tokens to deposit\n function sponsor(uint256 amount) external override nonReentrant {\n _depositToAave(amount);\n emit Sponsored(msg.sender, amount);\n }\n\n /// @notice Claims the accrued rewards for the aToken, accumulating any pending rewards.\n /// @param to Address where the claimed rewards will be sent.\n /// @return True if operation was successful.\n function claimRewards(address to) external onlyManagerOrOwner returns (bool) {\n require(to != address(0), \"ATokenYieldSource/recipient-not-zero-address\");\n\n IAaveIncentivesController _incentivesController = incentivesController;\n\n address[] memory _assets = new address[](1);\n _assets[0] = address(aToken);\n\n uint256 _amount = _incentivesController.getRewardsBalance(_assets, address(this));\n uint256 _amountClaimed = _incentivesController.claimRewards(_assets, _amount, to);\n\n emit Claimed(msg.sender, to, _amountClaimed);\n return true;\n }\n\n /// @notice Retrieves Aave LendingPool address\n /// @return A reference to LendingPool interface\n function _lendingPool() internal view returns (ILendingPool) {\n return ILendingPool(\n ILendingPoolAddressesProvider(\n lendingPoolAddressesProviderRegistry.getAddressesProvidersList()[ADDRESSES_PROVIDER_ID]\n ).getLendingPool()\n );\n }\n}\n" + }, + "@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" + }, + "@pooltogether/fixed-point/contracts/FixedPoint.sol": { + "content": "/**\nCopyright 2020 PoolTogether Inc.\n\nThis file is part of PoolTogether.\n\nPoolTogether is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation under version 3 of the License.\n\nPoolTogether is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with PoolTogether. If not, see .\n*/\n\npragma solidity >=0.4.0;\n\nimport \"./external/openzeppelin/OpenZeppelinSafeMath_V3_3_0.sol\";\n\n/**\n * @author Brendan Asselstine\n * @notice Provides basic fixed point math calculations.\n *\n * This library calculates integer fractions by scaling values by 1e18 then performing standard integer math.\n */\nlibrary FixedPoint {\n using OpenZeppelinSafeMath_V3_3_0 for uint256;\n\n // The scale to use for fixed point numbers. Same as Ether for simplicity.\n uint256 internal constant SCALE = 1e18;\n\n /**\n * Calculates a Fixed18 mantissa given the numerator and denominator\n *\n * The mantissa = (numerator * 1e18) / denominator\n *\n * @param numerator The mantissa numerator\n * @param denominator The mantissa denominator\n * @return The mantissa of the fraction\n */\n function calculateMantissa(uint256 numerator, uint256 denominator) internal pure returns (uint256) {\n uint256 mantissa = numerator.mul(SCALE);\n mantissa = mantissa.div(denominator);\n return mantissa;\n }\n\n /**\n * Multiplies a Fixed18 number by an integer.\n *\n * @param b The whole integer to multiply\n * @param mantissa The Fixed18 number\n * @return An integer that is the result of multiplying the params.\n */\n function multiplyUintByMantissa(uint256 b, uint256 mantissa) internal pure returns (uint256) {\n uint256 result = mantissa.mul(b);\n result = result.div(SCALE);\n return result;\n }\n\n /**\n * Divides an integer by a fixed point 18 mantissa\n *\n * @param dividend The integer to divide\n * @param mantissa The fixed point 18 number to serve as the divisor\n * @return An integer that is the result of dividing an integer by a fixed point 18 mantissa\n */\n function divideUintByMantissa(uint256 dividend, uint256 mantissa) internal pure returns (uint256) {\n uint256 result = SCALE.mul(dividend);\n result = result.div(mantissa);\n return result;\n }\n}\n" + }, + "@pooltogether/aave-yield-source/contracts/external/aave/ILendingPool.sol": { + "content": "// SPDX-License-Identifier: agpl-3.0\npragma solidity 0.8.6;\n\ninterface ILendingPool {\n\n /**\n * @dev Deposits an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.\n * - E.g. User deposits 100 USDC and gets in return 100 aUSDC\n * @param asset The address of the underlying asset to deposit\n * @param amount The amount to be deposited\n * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user\n * wants to receive them on his own wallet, or a different address if the beneficiary of aTokens\n * is a different wallet\n * @param referralCode Code used to register the integrator originating the operation, for potential rewards.\n * 0 if the action is executed directly by the user, without any middle-man\n **/\n function deposit(\n address asset,\n uint256 amount,\n address onBehalfOf,\n uint16 referralCode\n ) external;\n\n /**\n * @dev Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned\n * E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC\n * @param asset The address of the underlying asset to withdraw\n * @param amount The underlying amount to be withdrawn\n * - Send the value type(uint256).max in order to withdraw the whole aToken balance\n * @param to Address that will receive the underlying, same as msg.sender if the user\n * wants to receive it on his own wallet, or a different address if the beneficiary is a\n * different wallet\n * @return The final amount withdrawn\n **/\n function withdraw(\n address asset,\n uint256 amount,\n address to\n ) external returns (uint256);\n\n}\n" + }, + "@pooltogether/aave-yield-source/contracts/external/aave/ILendingPoolAddressesProvider.sol": { + "content": "// SPDX-License-Identifier: agpl-3.0\npragma solidity 0.8.6;\n\n/**\n * @title LendingPoolAddressesProvider contract\n * @dev Main registry of addresses part of or connected to the protocol, including permissioned roles\n * - Acting also as factory of proxies and admin of those, so with right to change its implementations\n * - Owned by the Aave Governance\n * @author Aave\n **/\ninterface ILendingPoolAddressesProvider {\n event MarketIdSet(string newMarketId);\n event LendingPoolUpdated(address indexed newAddress);\n event ConfigurationAdminUpdated(address indexed newAddress);\n event EmergencyAdminUpdated(address indexed newAddress);\n event LendingPoolConfiguratorUpdated(address indexed newAddress);\n event LendingPoolCollateralManagerUpdated(address indexed newAddress);\n event PriceOracleUpdated(address indexed newAddress);\n event LendingRateOracleUpdated(address indexed newAddress);\n event ProxyCreated(bytes32 id, address indexed newAddress);\n event AddressSet(bytes32 id, address indexed newAddress, bool hasProxy);\n\n function getMarketId() external view returns (string memory);\n\n function setMarketId(string calldata marketId) external;\n\n function setAddress(bytes32 id, address newAddress) external;\n\n function setAddressAsProxy(bytes32 id, address impl) external;\n\n function getAddress(bytes32 id) external view returns (address);\n\n function getLendingPool() external view returns (address);\n\n function setLendingPoolImpl(address pool) external;\n\n function getLendingPoolConfigurator() external view returns (address);\n\n function setLendingPoolConfiguratorImpl(address configurator) external;\n\n function getLendingPoolCollateralManager() external view returns (address);\n\n function setLendingPoolCollateralManager(address manager) external;\n\n function getPoolAdmin() external view returns (address);\n\n function setPoolAdmin(address admin) external;\n\n function getEmergencyAdmin() external view returns (address);\n\n function setEmergencyAdmin(address admin) external;\n\n function getPriceOracle() external view returns (address);\n\n function setPriceOracle(address priceOracle) external;\n\n function getLendingRateOracle() external view returns (address);\n\n function setLendingRateOracle(address lendingRateOracle) external;\n}\n" + }, + "@pooltogether/aave-yield-source/contracts/external/aave/ILendingPoolAddressesProviderRegistry.sol": { + "content": "// SPDX-License-Identifier: agpl-3.0\npragma solidity 0.8.6;\n\n/**\n * @title LendingPoolAddressesProviderRegistry contract\n * @dev Main registry of LendingPoolAddressesProvider of multiple Aave protocol's markets\n * - Used for indexing purposes of Aave protocol's markets\n * - The id assigned to a LendingPoolAddressesProvider refers to the market it is connected with,\n * for example with `0` for the Aave main market and `1` for the next created\n * @author Aave\n **/\ninterface ILendingPoolAddressesProviderRegistry {\n event AddressesProviderRegistered(address indexed newAddress);\n event AddressesProviderUnregistered(address indexed newAddress);\n\n function getAddressesProvidersList() external view returns (address[] memory);\n\n function getAddressesProviderIdByAddress(address addressesProvider)\n external\n view\n returns (uint256);\n\n function registerAddressesProvider(address provider, uint256 id) external;\n\n function unregisterAddressesProvider(address provider) external;\n}\n" + }, + "@pooltogether/aave-yield-source/contracts/external/aave/ATokenInterface.sol": { + "content": "// SPDX-License-Identifier: agpl-3.0\n\npragma solidity 0.8.6;\n\nimport \"./IAToken.sol\";\n\ninterface ATokenInterface is IAToken {\n /**\n * @dev Returns the address of the underlying asset of this aToken (E.g. WETH for aWETH)\n **/\n /* solhint-disable-next-line func-name-mixedcase */\n function UNDERLYING_ASSET_ADDRESS() external view returns (address);\n}\n" + }, + "@pooltogether/aave-yield-source/contracts/external/aave/IAaveIncentivesController.sol": { + "content": "// SPDX-License-Identifier: agpl-3.0\n\npragma solidity 0.8.6;\n\npragma experimental ABIEncoderV2;\n\ninterface IAaveIncentivesController {\n event RewardsAccrued(address indexed user, uint256 amount);\n\n event RewardsClaimed(address indexed user, address indexed to, uint256 amount);\n\n // Commented out to avoid displaying warnings about duplicate definition\n // event RewardsClaimed(\n // address indexed user,\n // address indexed to,\n // address indexed claimer,\n // uint256 amount\n // );\n\n event ClaimerSet(address indexed user, address indexed claimer);\n\n /*\n * @dev Returns the configuration of the distribution for a certain asset\n * @param asset The address of the reference asset of the distribution\n * @return The asset index, the emission per second and the last updated timestamp\n **/\n function getAssetData(address asset)\n external\n view\n returns (\n uint256,\n uint256,\n uint256\n );\n\n /**\n * @dev Whitelists an address to claim the rewards on behalf of another address\n * @param user The address of the user\n * @param claimer The address of the claimer\n */\n function setClaimer(address user, address claimer) external;\n\n /**\n * @dev Returns the whitelisted claimer for a certain address (0x0 if not set)\n * @param user The address of the user\n * @return The claimer address\n */\n function getClaimer(address user) external view returns (address);\n\n /**\n * @dev Configure assets for a certain rewards emission\n * @param assets The assets to incentivize\n * @param emissionsPerSecond The emission for each asset\n */\n function configureAssets(address[] calldata assets, uint256[] calldata emissionsPerSecond)\n external;\n\n /**\n * @dev Called by the corresponding asset on any update that affects the rewards distribution\n * @param asset The address of the user\n * @param userBalance The balance of the user of the asset in the lending pool\n * @param totalSupply The total supply of the asset in the lending pool\n **/\n function handleAction(\n address asset,\n uint256 userBalance,\n uint256 totalSupply\n ) external;\n\n /**\n * @dev Returns the total of rewards of an user, already accrued + not yet accrued\n * @param user The address of the user\n * @return The rewards\n **/\n function getRewardsBalance(address[] calldata assets, address user)\n external\n view\n returns (uint256);\n\n /**\n * @dev Claims reward for an user, on all the assets of the lending pool, accumulating the pending rewards\n * @param amount Amount of rewards to claim\n * @param to Address that will be receiving the rewards\n * @return Rewards claimed\n **/\n function claimRewards(\n address[] calldata assets,\n uint256 amount,\n address to\n ) external returns (uint256);\n\n /**\n * @dev Claims reward for an user on behalf, on all the assets of the lending pool, accumulating the pending rewards. The caller must\n * be whitelisted via \"allowClaimOnBehalf\" function by the RewardsAdmin role manager\n * @param amount Amount of rewards to claim\n * @param user Address to check and claim rewards\n * @param to Address that will be receiving the rewards\n * @return Rewards claimed\n **/\n function claimRewardsOnBehalf(\n address[] calldata assets,\n uint256 amount,\n address user,\n address to\n ) external returns (uint256);\n\n /**\n * @dev returns the unclaimed rewards of the user\n * @param user the address of the user\n * @return the unclaimed user rewards\n */\n function getUserUnclaimedRewards(address user) external view returns (uint256);\n\n /**\n * @dev returns the unclaimed rewards of the user\n * @param user the address of the user\n * @param asset The asset to incentivize\n * @return the user index for the asset\n */\n function getUserAssetData(address user, address asset) external view returns (uint256);\n\n /**\n * @dev for backward compatibility with previous implementation of the Incentives controller\n */\n function REWARD_TOKEN() external view returns (address);\n\n /**\n * @dev for backward compatibility with previous implementation of the Incentives controller\n */\n function PRECISION() external view returns (uint8);\n\n /**\n * @dev Gets the distribution end timestamp of the emissions\n */\n function DISTRIBUTION_END() external view returns (uint256);\n}\n" + }, + "@pooltogether/fixed-point/contracts/external/openzeppelin/OpenZeppelinSafeMath_V3_3_0.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// NOTE: Copied from OpenZeppelin Contracts version 3.3.0\n\npragma solidity >=0.4.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary OpenZeppelinSafeMath_V3_3_0 {\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 uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n\n return c;\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 sub(a, b, \"SafeMath: subtraction overflow\");\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 * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n uint256 c = a - b;\n\n return c;\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 // 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) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts 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(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, \"SafeMath: division by zero\");\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts 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(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n uint256 c = a / b;\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n return c;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts 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 mod(a, b, \"SafeMath: modulo by zero\");\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {\n require(b != 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "@pooltogether/aave-yield-source/contracts/external/aave/IAToken.sol": { + "content": "// SPDX-License-Identifier: agpl-3.0\npragma solidity 0.8.6;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IAToken is IERC20 {\n /**\n * @dev Emitted after the mint action\n * @param from The address performing the mint\n * @param value The amount being\n * @param index The new liquidity index of the reserve\n **/\n event Mint(address indexed from, uint256 value, uint256 index);\n\n /**\n * @dev Mints `amount` aTokens to `user`\n * @param user The address receiving the minted tokens\n * @param amount The amount of tokens getting minted\n * @param index The new liquidity index of the reserve\n * @return `true` if the the previous balance of the user was 0\n */\n function mint(\n address user,\n uint256 amount,\n uint256 index\n ) external returns (bool);\n\n /**\n * @dev Emitted after aTokens are burned\n * @param from The owner of the aTokens, getting them burned\n * @param target The address that will receive the underlying\n * @param value The amount being burned\n * @param index The new liquidity index of the reserve\n **/\n event Burn(address indexed from, address indexed target, uint256 value, uint256 index);\n\n /**\n * @dev Emitted during the transfer action\n * @param from The user whose tokens are being transferred\n * @param to The recipient\n * @param value The amount being transferred\n * @param index The new liquidity index of the reserve\n **/\n event BalanceTransfer(address indexed from, address indexed to, uint256 value, uint256 index);\n\n /**\n * @dev Burns aTokens from `user` and sends the equivalent amount of underlying to `receiverOfUnderlying`\n * @param user The owner of the aTokens, getting them burned\n * @param receiverOfUnderlying The address that will receive the underlying\n * @param amount The amount being burned\n * @param index The new liquidity index of the reserve\n **/\n function burn(\n address user,\n address receiverOfUnderlying,\n uint256 amount,\n uint256 index\n ) external;\n\n /**\n * @dev Mints aTokens to the reserve treasury\n * @param amount The amount of tokens getting minted\n * @param index The new liquidity index of the reserve\n */\n function mintToTreasury(uint256 amount, uint256 index) external;\n\n /**\n * @dev Transfers aTokens in the event of a borrow being liquidated, in case the liquidators reclaims the aToken\n * @param from The address getting liquidated, current owner of the aTokens\n * @param to The recipient\n * @param value The amount of tokens getting transferred\n **/\n function transferOnLiquidation(\n address from,\n address to,\n uint256 value\n ) external;\n\n /**\n * @dev Transfers the underlying asset to `target`. Used by the LendingPool to transfer\n * assets in borrow(), withdraw() and flashLoan()\n * @param user The recipient of the aTokens\n * @param amount The amount getting transferred\n * @return The amount transferred\n **/\n function transferUnderlyingTo(address user, uint256 amount) external returns (uint256);\n}\n" + }, + "@pooltogether/v4-core/contracts/Reserve.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\nimport \"./interfaces/IReserve.sol\";\nimport \"./libraries/ObservationLib.sol\";\nimport \"./libraries/RingBufferLib.sol\";\n\n/**\n * @title PoolTogether V4 Reserve\n * @author PoolTogether Inc Team\n * @notice The Reserve contract provides historical lookups of a token balance increase during a target timerange.\n As the Reserve contract transfers OUT tokens, the withdraw accumulator is increased. When tokens are\n transfered IN new checkpoint *can* be created if checkpoint() is called after transfering tokens.\n By using the reserve and withdraw accumulators to create a new checkpoint, any contract or account\n can lookup the balance increase of the reserve for a target timerange. \n * @dev By calculating the total held tokens in a specific time range, contracts that require knowledge \n of captured interest during a draw period, can easily call into the Reserve and deterministically\n determine the newly aqcuired tokens for that time range. \n */\ncontract Reserve is IReserve, Manageable {\n using SafeERC20 for IERC20;\n\n /// @notice ERC20 token\n IERC20 public immutable token;\n\n /// @notice Total withdraw amount from reserve\n uint224 public withdrawAccumulator;\n uint32 private _gap;\n\n uint24 internal nextIndex;\n uint24 internal cardinality;\n\n /// @notice The maximum number of twab entries\n uint24 internal constant MAX_CARDINALITY = 16777215; // 2**24 - 1\n\n ObservationLib.Observation[MAX_CARDINALITY] internal reserveAccumulators;\n\n /* ============ Events ============ */\n\n event Deployed(IERC20 indexed token);\n\n /* ============ Constructor ============ */\n\n /**\n * @notice Constructs Ticket with passed parameters.\n * @param _owner Owner address\n * @param _token ERC20 address\n */\n constructor(address _owner, IERC20 _token) Ownable(_owner) {\n token = _token;\n emit Deployed(_token);\n }\n\n /* ============ External Functions ============ */\n\n /// @inheritdoc IReserve\n function checkpoint() external override {\n _checkpoint();\n }\n\n /// @inheritdoc IReserve\n function getToken() external view override returns (IERC20) {\n return token;\n }\n\n /// @inheritdoc IReserve\n function getReserveAccumulatedBetween(uint32 _startTimestamp, uint32 _endTimestamp)\n external\n view\n override\n returns (uint224)\n {\n require(_startTimestamp < _endTimestamp, \"Reserve/start-less-then-end\");\n uint24 _cardinality = cardinality;\n uint24 _nextIndex = nextIndex;\n\n (uint24 _newestIndex, ObservationLib.Observation memory _newestObservation) = _getNewestObservation(_nextIndex);\n (uint24 _oldestIndex, ObservationLib.Observation memory _oldestObservation) = _getOldestObservation(_nextIndex);\n\n uint224 _start = _getReserveAccumulatedAt(\n _newestObservation,\n _oldestObservation,\n _newestIndex,\n _oldestIndex,\n _cardinality,\n _startTimestamp\n );\n\n uint224 _end = _getReserveAccumulatedAt(\n _newestObservation,\n _oldestObservation,\n _newestIndex,\n _oldestIndex,\n _cardinality,\n _endTimestamp\n );\n\n return _end - _start;\n }\n\n /// @inheritdoc IReserve\n function withdrawTo(address _recipient, uint256 _amount) external override onlyManagerOrOwner {\n _checkpoint();\n\n withdrawAccumulator += uint224(_amount);\n \n token.safeTransfer(_recipient, _amount);\n\n emit Withdrawn(_recipient, _amount);\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Find optimal observation checkpoint using target timestamp\n * @dev Uses binary search if target timestamp is within ring buffer range.\n * @param _newestObservation ObservationLib.Observation\n * @param _oldestObservation ObservationLib.Observation\n * @param _newestIndex The index of the newest observation\n * @param _oldestIndex The index of the oldest observation\n * @param _cardinality RingBuffer Range\n * @param _timestamp Timestamp target\n *\n * @return Optimal reserveAccumlator for timestamp.\n */\n function _getReserveAccumulatedAt(\n ObservationLib.Observation memory _newestObservation,\n ObservationLib.Observation memory _oldestObservation,\n uint24 _newestIndex,\n uint24 _oldestIndex,\n uint24 _cardinality,\n uint32 _timestamp\n ) internal view returns (uint224) {\n uint32 timeNow = uint32(block.timestamp);\n\n // IF empty ring buffer exit early.\n if (_cardinality == 0) return 0;\n\n /**\n * Ring Buffer Search Optimization\n * Before performing binary search on the ring buffer check\n * to see if timestamp is within range of [o T n] by comparing\n * the target timestamp to the oldest/newest observation.timestamps\n * IF the timestamp is out of the ring buffer range avoid starting\n * a binary search, because we can return NULL or oldestObservation.amount\n */\n\n /**\n * IF oldestObservation.timestamp is after timestamp: T[old ]\n * the Reserve did NOT have a balance or the ring buffer\n * no longer contains that timestamp checkpoint.\n */\n if (_oldestObservation.timestamp > _timestamp) {\n return 0;\n }\n\n /**\n * IF newestObservation.timestamp is before timestamp: [ new]T\n * return _newestObservation.amount since observation\n * contains the highest checkpointed reserveAccumulator.\n */\n if (_newestObservation.timestamp <= _timestamp) {\n return _newestObservation.amount;\n }\n\n // IF the timestamp is witin range of ring buffer start/end: [new T old]\n // FIND the closest observation to the left(or exact) of timestamp: [OT ]\n (\n ObservationLib.Observation memory beforeOrAt,\n ObservationLib.Observation memory atOrAfter\n ) = ObservationLib.binarySearch(\n reserveAccumulators,\n _newestIndex,\n _oldestIndex,\n _timestamp,\n _cardinality,\n timeNow\n );\n\n // IF target timestamp is EXACT match for atOrAfter.timestamp observation return amount.\n // NOT having an exact match with atOrAfter means values will contain accumulator value AFTER the searchable range.\n // ELSE return observation.totalDepositedAccumulator closest to LEFT of target timestamp.\n if (atOrAfter.timestamp == _timestamp) {\n return atOrAfter.amount;\n } else {\n return beforeOrAt.amount;\n }\n }\n\n /// @notice Records the currently accrued reserve amount.\n function _checkpoint() internal {\n uint24 _cardinality = cardinality;\n uint24 _nextIndex = nextIndex;\n uint256 _balanceOfReserve = token.balanceOf(address(this));\n uint224 _withdrawAccumulator = withdrawAccumulator; //sload\n (uint24 newestIndex, ObservationLib.Observation memory newestObservation) = _getNewestObservation(_nextIndex);\n\n /**\n * IF tokens have been deposited into Reserve contract since the last checkpoint\n * create a new Reserve balance checkpoint. The will will update multiple times in a single block.\n */\n if (_balanceOfReserve + _withdrawAccumulator > newestObservation.amount) {\n uint32 nowTime = uint32(block.timestamp);\n\n // checkpointAccumulator = currentBalance + totalWithdraws\n uint224 newReserveAccumulator = uint224(_balanceOfReserve) + _withdrawAccumulator;\n\n // IF newestObservation IS NOT in the current block.\n // CREATE observation in the accumulators ring buffer.\n if (newestObservation.timestamp != nowTime) {\n reserveAccumulators[_nextIndex] = ObservationLib.Observation({\n amount: newReserveAccumulator,\n timestamp: nowTime\n });\n nextIndex = uint24(RingBufferLib.nextIndex(_nextIndex, MAX_CARDINALITY));\n if (_cardinality < MAX_CARDINALITY) {\n cardinality = _cardinality + 1;\n }\n }\n // ELSE IF newestObservation IS in the current block.\n // UPDATE the checkpoint previously created in block history.\n else {\n reserveAccumulators[newestIndex] = ObservationLib.Observation({\n amount: newReserveAccumulator,\n timestamp: nowTime\n });\n }\n\n emit Checkpoint(newReserveAccumulator, _withdrawAccumulator);\n }\n }\n\n /// @notice Retrieves the oldest observation\n /// @param _nextIndex The next index of the Reserve observations\n function _getOldestObservation(uint24 _nextIndex)\n internal\n view\n returns (uint24 index, ObservationLib.Observation memory observation)\n {\n index = _nextIndex;\n observation = reserveAccumulators[index];\n\n // If the TWAB is not initialized we go to the beginning of the TWAB circular buffer at index 0\n if (observation.timestamp == 0) {\n index = 0;\n observation = reserveAccumulators[0];\n }\n }\n\n /// @notice Retrieves the newest observation\n /// @param _nextIndex The next index of the Reserve observations\n function _getNewestObservation(uint24 _nextIndex)\n internal\n view\n returns (uint24 index, ObservationLib.Observation memory observation)\n {\n index = uint24(RingBufferLib.newestIndex(_nextIndex, MAX_CARDINALITY));\n observation = reserveAccumulators[index];\n }\n}\n" + }, + "@pooltogether/v4-core/contracts/interfaces/IReserve.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IReserve {\n /**\n * @notice Emit when checkpoint is created.\n * @param reserveAccumulated Total depsosited\n * @param withdrawAccumulated Total withdrawn\n */\n\n event Checkpoint(uint256 reserveAccumulated, uint256 withdrawAccumulated);\n /**\n * @notice Emit when the withdrawTo function has executed.\n * @param recipient Address receiving funds\n * @param amount Amount of tokens transfered.\n */\n event Withdrawn(address indexed recipient, uint256 amount);\n\n /**\n * @notice Create observation checkpoint in ring bufferr.\n * @dev Calculates total desposited tokens since last checkpoint and creates new accumulator checkpoint.\n */\n function checkpoint() external;\n\n /**\n * @notice Read global token value.\n * @return IERC20\n */\n function getToken() external view returns (IERC20);\n\n /**\n * @notice Calculate token accumulation beween timestamp range.\n * @dev Search the ring buffer for two checkpoint observations and diffs accumulator amount.\n * @param startTimestamp Account address\n * @param endTimestamp Transfer amount\n */\n function getReserveAccumulatedBetween(uint32 startTimestamp, uint32 endTimestamp)\n external\n returns (uint224);\n\n /**\n * @notice Transfer Reserve token balance to recipient address.\n * @dev Creates checkpoint before token transfer. Increments withdrawAccumulator with amount.\n * @param recipient Account address\n * @param amount Transfer amount\n */\n function withdrawTo(address recipient, uint256 amount) external;\n}\n" + }, + "@pooltogether/v4-core/contracts/DrawBeacon.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\nimport \"@pooltogether/pooltogether-rng-contracts/contracts/RNGInterface.sol\";\nimport \"@pooltogether/owner-manager-contracts/contracts/Ownable.sol\";\n\nimport \"./interfaces/IDrawBeacon.sol\";\nimport \"./interfaces/IDrawBuffer.sol\";\n\n\n/**\n * @title PoolTogether V4 DrawBeacon\n * @author PoolTogether Inc Team\n * @notice Manages RNG (random number generator) requests and pushing Draws onto DrawBuffer.\n The DrawBeacon has 3 major actions for requesting a random number: start, cancel and complete.\n To create a new Draw, the user requests a new random number from the RNG service.\n When the random number is available, the user can create the draw using the create() method\n which will push the draw onto the DrawBuffer.\n If the RNG service fails to deliver a rng, when the request timeout elapses, the user can cancel the request.\n*/\ncontract DrawBeacon is IDrawBeacon, Ownable {\n using SafeCast for uint256;\n using SafeERC20 for IERC20;\n\n /* ============ Variables ============ */\n\n /// @notice RNG contract interface\n RNGInterface internal rng;\n\n /// @notice Current RNG Request\n RngRequest internal rngRequest;\n\n /// @notice DrawBuffer address\n IDrawBuffer internal drawBuffer;\n\n /**\n * @notice RNG Request Timeout. In fact, this is really a \"complete draw\" timeout.\n * @dev If the rng completes the award can still be cancelled.\n */\n uint32 internal rngTimeout;\n\n /// @notice Seconds between beacon period request\n uint32 internal beaconPeriodSeconds;\n\n /// @notice Epoch timestamp when beacon period can start\n uint64 internal beaconPeriodStartedAt;\n\n /**\n * @notice Next Draw ID to use when pushing a Draw onto DrawBuffer\n * @dev Starts at 1. This way we know that no Draw has been recorded at 0.\n */\n uint32 internal nextDrawId;\n\n /* ============ Structs ============ */\n\n /**\n * @notice RNG Request\n * @param id RNG request ID\n * @param lockBlock Block number that the RNG request is locked\n * @param requestedAt Time when RNG is requested\n */\n struct RngRequest {\n uint32 id;\n uint32 lockBlock;\n uint64 requestedAt;\n }\n\n /* ============ Events ============ */\n\n /**\n * @notice Emit when the DrawBeacon is deployed.\n * @param nextDrawId Draw ID at which the DrawBeacon should start. Can't be inferior to 1.\n * @param beaconPeriodStartedAt Timestamp when beacon period starts.\n */\n event Deployed(\n uint32 nextDrawId,\n uint64 beaconPeriodStartedAt\n );\n\n /* ============ Modifiers ============ */\n\n modifier requireDrawNotStarted() {\n _requireDrawNotStarted();\n _;\n }\n\n modifier requireCanStartDraw() {\n require(_isBeaconPeriodOver(), \"DrawBeacon/beacon-period-not-over\");\n require(!isRngRequested(), \"DrawBeacon/rng-already-requested\");\n _;\n }\n\n modifier requireCanCompleteRngRequest() {\n require(isRngRequested(), \"DrawBeacon/rng-not-requested\");\n require(isRngCompleted(), \"DrawBeacon/rng-not-complete\");\n _;\n }\n\n /* ============ Constructor ============ */\n\n /**\n * @notice Deploy the DrawBeacon smart contract.\n * @param _owner Address of the DrawBeacon owner\n * @param _drawBuffer The address of the draw buffer to push draws to\n * @param _rng The RNG service to use\n * @param _nextDrawId Draw ID at which the DrawBeacon should start. Can't be inferior to 1.\n * @param _beaconPeriodStart The starting timestamp of the beacon period.\n * @param _beaconPeriodSeconds The duration of the beacon period in seconds\n */\n constructor(\n address _owner,\n IDrawBuffer _drawBuffer,\n RNGInterface _rng,\n uint32 _nextDrawId,\n uint64 _beaconPeriodStart,\n uint32 _beaconPeriodSeconds,\n uint32 _rngTimeout\n ) Ownable(_owner) {\n require(_beaconPeriodStart > 0, \"DrawBeacon/beacon-period-greater-than-zero\");\n require(address(_rng) != address(0), \"DrawBeacon/rng-not-zero\");\n require(_nextDrawId >= 1, \"DrawBeacon/next-draw-id-gte-one\");\n\n beaconPeriodStartedAt = _beaconPeriodStart;\n nextDrawId = _nextDrawId;\n\n _setBeaconPeriodSeconds(_beaconPeriodSeconds);\n _setDrawBuffer(_drawBuffer);\n _setRngService(_rng);\n _setRngTimeout(_rngTimeout);\n\n emit Deployed(_nextDrawId, _beaconPeriodStart);\n emit BeaconPeriodStarted(_beaconPeriodStart);\n }\n\n /* ============ Public Functions ============ */\n\n /**\n * @notice Returns whether the random number request has completed.\n * @return True if a random number request has completed, false otherwise.\n */\n function isRngCompleted() public view override returns (bool) {\n return rng.isRequestComplete(rngRequest.id);\n }\n\n /**\n * @notice Returns whether a random number has been requested\n * @return True if a random number has been requested, false otherwise.\n */\n function isRngRequested() public view override returns (bool) {\n return rngRequest.id != 0;\n }\n\n /**\n * @notice Returns whether the random number request has timed out.\n * @return True if a random number request has timed out, false otherwise.\n */\n function isRngTimedOut() public view override returns (bool) {\n if (rngRequest.requestedAt == 0) {\n return false;\n } else {\n return rngTimeout + rngRequest.requestedAt < _currentTime();\n }\n }\n\n /* ============ External Functions ============ */\n\n /// @inheritdoc IDrawBeacon\n function canStartDraw() external view override returns (bool) {\n return _isBeaconPeriodOver() && !isRngRequested();\n }\n\n /// @inheritdoc IDrawBeacon\n function canCompleteDraw() external view override returns (bool) {\n return isRngRequested() && isRngCompleted();\n }\n\n /// @notice Calculates the next beacon start time, assuming all beacon periods have occurred between the last and now.\n /// @return The next beacon period start time\n function calculateNextBeaconPeriodStartTimeFromCurrentTime() external view returns (uint64) {\n return\n _calculateNextBeaconPeriodStartTime(\n beaconPeriodStartedAt,\n beaconPeriodSeconds,\n _currentTime()\n );\n }\n\n /// @inheritdoc IDrawBeacon\n function calculateNextBeaconPeriodStartTime(uint64 _time)\n external\n view\n override\n returns (uint64)\n {\n return\n _calculateNextBeaconPeriodStartTime(\n beaconPeriodStartedAt,\n beaconPeriodSeconds,\n _time\n );\n }\n\n /// @inheritdoc IDrawBeacon\n function cancelDraw() external override {\n require(isRngTimedOut(), \"DrawBeacon/rng-not-timedout\");\n uint32 requestId = rngRequest.id;\n uint32 lockBlock = rngRequest.lockBlock;\n delete rngRequest;\n emit DrawCancelled(requestId, lockBlock);\n }\n\n /// @inheritdoc IDrawBeacon\n function completeDraw() external override requireCanCompleteRngRequest {\n uint256 randomNumber = rng.randomNumber(rngRequest.id);\n uint32 _nextDrawId = nextDrawId;\n uint64 _beaconPeriodStartedAt = beaconPeriodStartedAt;\n uint32 _beaconPeriodSeconds = beaconPeriodSeconds;\n uint64 _time = _currentTime();\n\n // create Draw struct\n IDrawBeacon.Draw memory _draw = IDrawBeacon.Draw({\n winningRandomNumber: randomNumber,\n drawId: _nextDrawId,\n timestamp: rngRequest.requestedAt, // must use the startAward() timestamp to prevent front-running\n beaconPeriodStartedAt: _beaconPeriodStartedAt,\n beaconPeriodSeconds: _beaconPeriodSeconds\n });\n\n drawBuffer.pushDraw(_draw);\n\n // to avoid clock drift, we should calculate the start time based on the previous period start time.\n uint64 nextBeaconPeriodStartedAt = _calculateNextBeaconPeriodStartTime(\n _beaconPeriodStartedAt,\n _beaconPeriodSeconds,\n _time\n );\n beaconPeriodStartedAt = nextBeaconPeriodStartedAt;\n nextDrawId = _nextDrawId + 1;\n\n // Reset the rngRequest state so Beacon period can start again.\n delete rngRequest;\n\n emit DrawCompleted(randomNumber);\n emit BeaconPeriodStarted(nextBeaconPeriodStartedAt);\n }\n\n /// @inheritdoc IDrawBeacon\n function beaconPeriodRemainingSeconds() external view override returns (uint64) {\n return _beaconPeriodRemainingSeconds();\n }\n\n /// @inheritdoc IDrawBeacon\n function beaconPeriodEndAt() external view override returns (uint64) {\n return _beaconPeriodEndAt();\n }\n\n function getBeaconPeriodSeconds() external view returns (uint32) {\n return beaconPeriodSeconds;\n }\n\n function getBeaconPeriodStartedAt() external view returns (uint64) {\n return beaconPeriodStartedAt;\n }\n\n function getDrawBuffer() external view returns (IDrawBuffer) {\n return drawBuffer;\n }\n\n function getNextDrawId() external view returns (uint32) {\n return nextDrawId;\n }\n\n /// @inheritdoc IDrawBeacon\n function getLastRngLockBlock() external view override returns (uint32) {\n return rngRequest.lockBlock;\n }\n\n function getLastRngRequestId() external view override returns (uint32) {\n return rngRequest.id;\n }\n\n function getRngService() external view returns (RNGInterface) {\n return rng;\n }\n\n function getRngTimeout() external view returns (uint32) {\n return rngTimeout;\n }\n\n /// @inheritdoc IDrawBeacon\n function isBeaconPeriodOver() external view override returns (bool) {\n return _isBeaconPeriodOver();\n }\n\n /// @inheritdoc IDrawBeacon\n function setDrawBuffer(IDrawBuffer newDrawBuffer)\n external\n override\n onlyOwner\n returns (IDrawBuffer)\n {\n return _setDrawBuffer(newDrawBuffer);\n }\n\n /// @inheritdoc IDrawBeacon\n function startDraw() external override requireCanStartDraw {\n (address feeToken, uint256 requestFee) = rng.getRequestFee();\n\n if (feeToken != address(0) && requestFee > 0) {\n IERC20(feeToken).safeIncreaseAllowance(address(rng), requestFee);\n }\n\n (uint32 requestId, uint32 lockBlock) = rng.requestRandomNumber();\n rngRequest.id = requestId;\n rngRequest.lockBlock = lockBlock;\n rngRequest.requestedAt = _currentTime();\n\n emit DrawStarted(requestId, lockBlock);\n }\n\n /// @inheritdoc IDrawBeacon\n function setBeaconPeriodSeconds(uint32 _beaconPeriodSeconds)\n external\n override\n onlyOwner\n requireDrawNotStarted\n {\n _setBeaconPeriodSeconds(_beaconPeriodSeconds);\n }\n\n /// @inheritdoc IDrawBeacon\n function setRngTimeout(uint32 _rngTimeout) external override onlyOwner requireDrawNotStarted {\n _setRngTimeout(_rngTimeout);\n }\n\n /// @inheritdoc IDrawBeacon\n function setRngService(RNGInterface _rngService)\n external\n override\n onlyOwner\n requireDrawNotStarted\n {\n _setRngService(_rngService);\n }\n\n /**\n * @notice Sets the RNG service that the Prize Strategy is connected to\n * @param _rngService The address of the new RNG service interface\n */\n function _setRngService(RNGInterface _rngService) internal\n {\n rng = _rngService;\n emit RngServiceUpdated(_rngService);\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Calculates when the next beacon period will start\n * @param _beaconPeriodStartedAt The timestamp at which the beacon period started\n * @param _beaconPeriodSeconds The duration of the beacon period in seconds\n * @param _time The timestamp to use as the current time\n * @return The timestamp at which the next beacon period would start\n */\n function _calculateNextBeaconPeriodStartTime(\n uint64 _beaconPeriodStartedAt,\n uint32 _beaconPeriodSeconds,\n uint64 _time\n ) internal pure returns (uint64) {\n uint64 elapsedPeriods = (_time - _beaconPeriodStartedAt) / _beaconPeriodSeconds;\n return _beaconPeriodStartedAt + (elapsedPeriods * _beaconPeriodSeconds);\n }\n\n /**\n * @notice returns the current time. Used for testing.\n * @return The current time (block.timestamp)\n */\n function _currentTime() internal view virtual returns (uint64) {\n return uint64(block.timestamp);\n }\n\n /**\n * @notice Returns the timestamp at which the beacon period ends\n * @return The timestamp at which the beacon period ends\n */\n function _beaconPeriodEndAt() internal view returns (uint64) {\n return beaconPeriodStartedAt + beaconPeriodSeconds;\n }\n\n /**\n * @notice Returns the number of seconds remaining until the prize can be awarded.\n * @return The number of seconds remaining until the prize can be awarded.\n */\n function _beaconPeriodRemainingSeconds() internal view returns (uint64) {\n uint64 endAt = _beaconPeriodEndAt();\n uint64 time = _currentTime();\n\n if (endAt <= time) {\n return 0;\n }\n\n return endAt - time;\n }\n\n /**\n * @notice Returns whether the beacon period is over.\n * @return True if the beacon period is over, false otherwise\n */\n function _isBeaconPeriodOver() internal view returns (bool) {\n return _beaconPeriodEndAt() <= _currentTime();\n }\n\n /**\n * @notice Check to see draw is in progress.\n */\n function _requireDrawNotStarted() internal view {\n uint256 currentBlock = block.number;\n\n require(\n rngRequest.lockBlock == 0 || currentBlock < rngRequest.lockBlock,\n \"DrawBeacon/rng-in-flight\"\n );\n }\n\n /**\n * @notice Set global DrawBuffer variable.\n * @dev All subsequent Draw requests/completions will be pushed to the new DrawBuffer.\n * @param _newDrawBuffer DrawBuffer address\n * @return DrawBuffer\n */\n function _setDrawBuffer(IDrawBuffer _newDrawBuffer) internal returns (IDrawBuffer) {\n IDrawBuffer _previousDrawBuffer = drawBuffer;\n require(address(_newDrawBuffer) != address(0), \"DrawBeacon/draw-history-not-zero-address\");\n\n require(\n address(_newDrawBuffer) != address(_previousDrawBuffer),\n \"DrawBeacon/existing-draw-history-address\"\n );\n\n drawBuffer = _newDrawBuffer;\n\n emit DrawBufferUpdated(_newDrawBuffer);\n\n return _newDrawBuffer;\n }\n\n /**\n * @notice Sets the beacon period in seconds.\n * @param _beaconPeriodSeconds The new beacon period in seconds. Must be greater than zero.\n */\n function _setBeaconPeriodSeconds(uint32 _beaconPeriodSeconds) internal {\n require(_beaconPeriodSeconds > 0, \"DrawBeacon/beacon-period-greater-than-zero\");\n beaconPeriodSeconds = _beaconPeriodSeconds;\n\n emit BeaconPeriodSecondsUpdated(_beaconPeriodSeconds);\n }\n\n /**\n * @notice Sets the RNG request timeout in seconds. This is the time that must elapsed before the RNG request can be cancelled and the pool unlocked.\n * @param _rngTimeout The RNG request timeout in seconds.\n */\n function _setRngTimeout(uint32 _rngTimeout) internal {\n require(_rngTimeout > 60, \"DrawBeacon/rng-timeout-gt-60-secs\");\n rngTimeout = _rngTimeout;\n\n emit RngTimeoutSet(_rngTimeout);\n }\n}\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-core/contracts/DrawBeacon.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-core/contracts/DrawBeacon.sol';\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-core/contracts/PrizeDistributionBuffer.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-core/contracts/PrizeDistributionBuffer.sol';\n" + }, + "@pooltogether/v4-timelocks/contracts/L1TimelockTrigger.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.6;\nimport \"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\";\nimport \"@pooltogether/v4-core/contracts/interfaces/IPrizeDistributionBuffer.sol\";\nimport \"./interfaces/IDrawCalculatorTimelock.sol\";\n\n/**\n * @title PoolTogether V4 L1TimelockTrigger\n * @author PoolTogether Inc Team\n * @notice L1TimelockTrigger(s) acts as an intermediary between multiple V4 smart contracts.\n The L1TimelockTrigger is responsible for pushing Draws to a DrawBuffer and routing\n claim requests from a PrizeDistributor to a DrawCalculator. The primary objective is\n to include a \"cooldown\" period for all new Draws. Allowing the correction of a\n malicously set Draw in the unfortunate event an Owner is compromised.\n*/\ncontract L1TimelockTrigger is Manageable {\n /* ============ Events ============ */\n\n /// @notice Emitted when the contract is deployed.\n /// @param prizeDistributionBuffer The address of the prize distribution buffer contract.\n /// @param timelock The address of the DrawCalculatorTimelock\n event Deployed(\n IPrizeDistributionBuffer indexed prizeDistributionBuffer,\n IDrawCalculatorTimelock indexed timelock\n );\n\n /**\n * @notice Emitted when target prize distribution is pushed.\n * @param drawId Draw ID\n * @param prizeDistribution PrizeDistribution\n */\n event PrizeDistributionPushed(\n uint32 indexed drawId,\n IPrizeDistributionBuffer.PrizeDistribution prizeDistribution\n );\n\n /* ============ Global Variables ============ */\n\n /// @notice Internal PrizeDistributionBuffer reference.\n IPrizeDistributionBuffer public immutable prizeDistributionBuffer;\n\n /// @notice Timelock struct reference.\n IDrawCalculatorTimelock public timelock;\n\n /* ============ Deploy ============ */\n\n /**\n * @notice Initialize L1TimelockTrigger smart contract.\n * @param _owner Address of the L1TimelockTrigger owner.\n * @param _prizeDistributionBuffer PrizeDistributionBuffer address\n * @param _timelock Elapsed seconds before new Draw is available\n */\n constructor(\n address _owner,\n IPrizeDistributionBuffer _prizeDistributionBuffer,\n IDrawCalculatorTimelock _timelock\n ) Ownable(_owner) {\n prizeDistributionBuffer = _prizeDistributionBuffer;\n timelock = _timelock;\n\n emit Deployed(_prizeDistributionBuffer, _timelock);\n }\n\n /**\n * @notice Push Draw onto draws ring buffer history.\n * @dev Restricts new draws by forcing a push timelock.\n * @param _draw Draw struct\n * @param _prizeDistribution PrizeDistribution struct\n */\n function push(\n IDrawBeacon.Draw calldata _draw,\n IPrizeDistributionBuffer.PrizeDistribution memory _prizeDistribution\n ) external onlyManagerOrOwner {\n // Locks the new PrizeDistribution according to the Draw endtime.\n timelock.lock(_draw.drawId, _draw.timestamp + _draw.beaconPeriodSeconds);\n prizeDistributionBuffer.pushPrizeDistribution(_draw.drawId, _prizeDistribution);\n emit PrizeDistributionPushed(_draw.drawId, _prizeDistribution);\n }\n}\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-timelocks/contracts/L1TimelockTrigger.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-timelocks/contracts/L1TimelockTrigger.sol';\n" + }, + "@pooltogether/v4-core/contracts/DrawCalculator.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"./interfaces/IDrawCalculator.sol\";\nimport \"./interfaces/ITicket.sol\";\nimport \"./interfaces/IDrawBuffer.sol\";\nimport \"./interfaces/IPrizeDistributionBuffer.sol\";\nimport \"./interfaces/IDrawBeacon.sol\";\n\n/**\n * @title PoolTogether V4 DrawCalculator\n * @author PoolTogether Inc Team\n * @notice The DrawCalculator calculates a user's prize by matching a winning random number against\n their picks. A users picks are generated deterministically based on their address and balance\n of tickets held. Prize payouts are divided into multiple tiers: grand prize, second place, etc...\n A user with a higher average weighted balance (during each draw period) will be given a large number of\n picks to choose from, and thus a higher chance to match the winning numbers.\n*/\ncontract DrawCalculator is IDrawCalculator {\n\n /// @notice DrawBuffer address\n IDrawBuffer public immutable drawBuffer;\n\n /// @notice Ticket associated with DrawCalculator\n ITicket public immutable ticket;\n\n /// @notice The stored history of draw settings. Stored as ring buffer.\n IPrizeDistributionBuffer public immutable prizeDistributionBuffer;\n\n /// @notice The tiers array length\n uint8 public constant TIERS_LENGTH = 16;\n\n /* ============ Constructor ============ */\n\n /// @notice Constructor for DrawCalculator\n /// @param _ticket Ticket associated with this DrawCalculator\n /// @param _drawBuffer The address of the draw buffer to push draws to\n /// @param _prizeDistributionBuffer PrizeDistributionBuffer address\n constructor(\n ITicket _ticket,\n IDrawBuffer _drawBuffer,\n IPrizeDistributionBuffer _prizeDistributionBuffer\n ) {\n require(address(_ticket) != address(0), \"DrawCalc/ticket-not-zero\");\n require(address(_prizeDistributionBuffer) != address(0), \"DrawCalc/pdb-not-zero\");\n require(address(_drawBuffer) != address(0), \"DrawCalc/dh-not-zero\");\n\n ticket = _ticket;\n drawBuffer = _drawBuffer;\n prizeDistributionBuffer = _prizeDistributionBuffer;\n\n emit Deployed(_ticket, _drawBuffer, _prizeDistributionBuffer);\n }\n\n /* ============ External Functions ============ */\n\n /// @inheritdoc IDrawCalculator\n function calculate(\n address _user,\n uint32[] calldata _drawIds,\n bytes calldata _pickIndicesForDraws\n ) external view override returns (uint256[] memory, bytes memory) {\n uint64[][] memory pickIndices = abi.decode(_pickIndicesForDraws, (uint64 [][]));\n require(pickIndices.length == _drawIds.length, \"DrawCalc/invalid-pick-indices-length\");\n\n // READ list of IDrawBeacon.Draw using the drawIds from drawBuffer\n IDrawBeacon.Draw[] memory draws = drawBuffer.getDraws(_drawIds);\n\n // READ list of IPrizeDistributionBuffer.PrizeDistribution using the drawIds\n IPrizeDistributionBuffer.PrizeDistribution[] memory _prizeDistributions = prizeDistributionBuffer\n .getPrizeDistributions(_drawIds);\n\n // The userBalances are fractions representing their portion of the liquidity for a draw.\n uint256[] memory userBalances = _getNormalizedBalancesAt(_user, draws, _prizeDistributions);\n\n // The users address is hashed once.\n bytes32 _userRandomNumber = keccak256(abi.encodePacked(_user));\n\n return _calculatePrizesAwardable(\n userBalances,\n _userRandomNumber,\n draws,\n pickIndices,\n _prizeDistributions\n );\n }\n\n /// @inheritdoc IDrawCalculator\n function getDrawBuffer() external view override returns (IDrawBuffer) {\n return drawBuffer;\n }\n\n /// @inheritdoc IDrawCalculator\n function getPrizeDistributionBuffer()\n external\n view\n override\n returns (IPrizeDistributionBuffer)\n {\n return prizeDistributionBuffer;\n }\n\n /// @inheritdoc IDrawCalculator\n function getNormalizedBalancesForDrawIds(address _user, uint32[] calldata _drawIds)\n external\n view\n override\n returns (uint256[] memory)\n {\n IDrawBeacon.Draw[] memory _draws = drawBuffer.getDraws(_drawIds);\n IPrizeDistributionBuffer.PrizeDistribution[] memory _prizeDistributions = prizeDistributionBuffer\n .getPrizeDistributions(_drawIds);\n\n return _getNormalizedBalancesAt(_user, _draws, _prizeDistributions);\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Calculates the prizes awardable for each Draw passed.\n * @param _normalizedUserBalances Fractions representing the user's portion of the liquidity for each draw.\n * @param _userRandomNumber Random number of the user to consider over draws\n * @param _draws List of Draws\n * @param _pickIndicesForDraws Pick indices for each Draw\n * @param _prizeDistributions PrizeDistribution for each Draw\n\n */\n function _calculatePrizesAwardable(\n uint256[] memory _normalizedUserBalances,\n bytes32 _userRandomNumber,\n IDrawBeacon.Draw[] memory _draws,\n uint64[][] memory _pickIndicesForDraws,\n IPrizeDistributionBuffer.PrizeDistribution[] memory _prizeDistributions\n ) internal view returns (uint256[] memory prizesAwardable, bytes memory prizeCounts) {\n\n uint256[] memory _prizesAwardable = new uint256[](_normalizedUserBalances.length);\n uint256[][] memory _prizeCounts = new uint256[][](_normalizedUserBalances.length);\n\n uint64 timeNow = uint64(block.timestamp);\n\n // calculate prizes awardable for each Draw passed\n for (uint32 drawIndex = 0; drawIndex < _draws.length; drawIndex++) {\n require(timeNow < _draws[drawIndex].timestamp + _prizeDistributions[drawIndex].expiryDuration, \"DrawCalc/draw-expired\");\n\n uint64 totalUserPicks = _calculateNumberOfUserPicks(\n _prizeDistributions[drawIndex],\n _normalizedUserBalances[drawIndex]\n );\n\n (_prizesAwardable[drawIndex], _prizeCounts[drawIndex]) = _calculate(\n _draws[drawIndex].winningRandomNumber,\n totalUserPicks,\n _userRandomNumber,\n _pickIndicesForDraws[drawIndex],\n _prizeDistributions[drawIndex]\n );\n }\n\n prizeCounts = abi.encode(_prizeCounts);\n prizesAwardable = _prizesAwardable;\n }\n\n /**\n * @notice Calculates the number of picks a user gets for a Draw, considering the normalized user balance and the PrizeDistribution.\n * @dev Divided by 1e18 since the normalized user balance is stored as a fixed point 18 number\n * @param _prizeDistribution The PrizeDistribution to consider\n * @param _normalizedUserBalance The normalized user balances to consider\n * @return The number of picks a user gets for a Draw\n */\n function _calculateNumberOfUserPicks(\n IPrizeDistributionBuffer.PrizeDistribution memory _prizeDistribution,\n uint256 _normalizedUserBalance\n ) internal pure returns (uint64) {\n return uint64((_normalizedUserBalance * _prizeDistribution.numberOfPicks) / 1 ether);\n }\n\n /**\n * @notice Calculates the normalized balance of a user against the total supply for timestamps\n * @param _user The user to consider\n * @param _draws The draws we are looking at\n * @param _prizeDistributions The prize tiers to consider (needed for draw timestamp offsets)\n * @return An array of normalized balances\n */\n function _getNormalizedBalancesAt(\n address _user,\n IDrawBeacon.Draw[] memory _draws,\n IPrizeDistributionBuffer.PrizeDistribution[] memory _prizeDistributions\n ) internal view returns (uint256[] memory) {\n uint256 drawsLength = _draws.length;\n uint64[] memory _timestampsWithStartCutoffTimes = new uint64[](drawsLength);\n uint64[] memory _timestampsWithEndCutoffTimes = new uint64[](drawsLength);\n\n // generate timestamps with draw cutoff offsets included\n for (uint32 i = 0; i < drawsLength; i++) {\n unchecked {\n _timestampsWithStartCutoffTimes[i] =\n _draws[i].timestamp - _prizeDistributions[i].startTimestampOffset;\n _timestampsWithEndCutoffTimes[i] =\n _draws[i].timestamp - _prizeDistributions[i].endTimestampOffset;\n }\n }\n\n uint256[] memory balances = ticket.getAverageBalancesBetween(\n _user,\n _timestampsWithStartCutoffTimes,\n _timestampsWithEndCutoffTimes\n );\n\n uint256[] memory totalSupplies = ticket.getAverageTotalSuppliesBetween(\n _timestampsWithStartCutoffTimes,\n _timestampsWithEndCutoffTimes\n );\n\n uint256[] memory normalizedBalances = new uint256[](drawsLength);\n\n // divide balances by total supplies (normalize)\n for (uint256 i = 0; i < drawsLength; i++) {\n if(totalSupplies[i] == 0){\n normalizedBalances[i] = 0;\n }\n else {\n normalizedBalances[i] = (balances[i] * 1 ether) / totalSupplies[i];\n }\n }\n\n return normalizedBalances;\n }\n\n /**\n * @notice Calculates the prize amount for a PrizeDistribution over given picks\n * @param _winningRandomNumber Draw's winningRandomNumber\n * @param _totalUserPicks number of picks the user gets for the Draw\n * @param _userRandomNumber users randomNumber for that draw\n * @param _picks users picks for that draw\n * @param _prizeDistribution PrizeDistribution for that draw\n * @return prize (if any), prizeCounts (if any)\n */\n function _calculate(\n uint256 _winningRandomNumber,\n uint256 _totalUserPicks,\n bytes32 _userRandomNumber,\n uint64[] memory _picks,\n IPrizeDistributionBuffer.PrizeDistribution memory _prizeDistribution\n ) internal pure returns (uint256 prize, uint256[] memory prizeCounts) {\n\n // create bitmasks for the PrizeDistribution\n uint256[] memory masks = _createBitMasks(_prizeDistribution);\n uint32 picksLength = uint32(_picks.length);\n uint256[] memory _prizeCounts = new uint256[](_prizeDistribution.tiers.length);\n\n uint8 maxWinningTierIndex = 0;\n\n require(\n picksLength <= _prizeDistribution.maxPicksPerUser,\n \"DrawCalc/exceeds-max-user-picks\"\n );\n\n // for each pick, find number of matching numbers and calculate prize distributions index\n for (uint32 index = 0; index < picksLength; index++) {\n require(_picks[index] < _totalUserPicks, \"DrawCalc/insufficient-user-picks\");\n\n if (index > 0) {\n require(_picks[index] > _picks[index - 1], \"DrawCalc/picks-ascending\");\n }\n\n // hash the user random number with the pick value\n uint256 randomNumberThisPick = uint256(\n keccak256(abi.encode(_userRandomNumber, _picks[index]))\n );\n\n uint8 tiersIndex = _calculateTierIndex(\n randomNumberThisPick,\n _winningRandomNumber,\n masks\n );\n\n // there is prize for this tier index\n if (tiersIndex < TIERS_LENGTH) {\n if (tiersIndex > maxWinningTierIndex) {\n maxWinningTierIndex = tiersIndex;\n }\n _prizeCounts[tiersIndex]++;\n }\n }\n\n // now calculate prizeFraction given prizeCounts\n uint256 prizeFraction = 0;\n uint256[] memory prizeTiersFractions = _calculatePrizeTierFractions(\n _prizeDistribution,\n maxWinningTierIndex\n );\n\n // multiple the fractions by the prizeCounts and add them up\n for (\n uint256 prizeCountIndex = 0;\n prizeCountIndex <= maxWinningTierIndex;\n prizeCountIndex++\n ) {\n if (_prizeCounts[prizeCountIndex] > 0) {\n prizeFraction +=\n prizeTiersFractions[prizeCountIndex] *\n _prizeCounts[prizeCountIndex];\n }\n }\n\n // return the absolute amount of prize awardable\n // div by 1e9 as prize tiers are base 1e9\n prize = (prizeFraction * _prizeDistribution.prize) / 1e9;\n prizeCounts = _prizeCounts;\n }\n\n ///@notice Calculates the tier index given the random numbers and masks\n ///@param _randomNumberThisPick users random number for this Pick\n ///@param _winningRandomNumber The winning number for this draw\n ///@param _masks The pre-calculate bitmasks for the prizeDistributions\n ///@return The position within the prize tier array (0 = top prize, 1 = runner-up prize, etc)\n function _calculateTierIndex(\n uint256 _randomNumberThisPick,\n uint256 _winningRandomNumber,\n uint256[] memory _masks\n ) internal pure returns (uint8) {\n uint8 numberOfMatches = 0;\n uint8 masksLength = uint8(_masks.length);\n\n // main number matching loop\n for (uint8 matchIndex = 0; matchIndex < masksLength; matchIndex++) {\n uint256 mask = _masks[matchIndex];\n\n if ((_randomNumberThisPick & mask) != (_winningRandomNumber & mask)) {\n // there are no more sequential matches since this comparison is not a match\n if (masksLength == numberOfMatches) {\n return 0;\n } else {\n return masksLength - numberOfMatches;\n }\n }\n\n // else there was a match\n numberOfMatches++;\n }\n\n return masksLength - numberOfMatches;\n }\n\n /**\n * @notice Create an array of bitmasks equal to the PrizeDistribution.matchCardinality length\n * @param _prizeDistribution The PrizeDistribution to use to calculate the masks\n * @return An array of bitmasks\n */\n function _createBitMasks(IPrizeDistributionBuffer.PrizeDistribution memory _prizeDistribution)\n internal\n pure\n returns (uint256[] memory)\n {\n uint256[] memory masks = new uint256[](_prizeDistribution.matchCardinality);\n masks[0] = (2**_prizeDistribution.bitRangeSize) - 1;\n\n for (uint8 maskIndex = 1; maskIndex < _prizeDistribution.matchCardinality; maskIndex++) {\n // shift mask bits to correct position and insert in result mask array\n masks[maskIndex] = masks[maskIndex - 1] << _prizeDistribution.bitRangeSize;\n }\n\n return masks;\n }\n\n /**\n * @notice Calculates the expected prize fraction per PrizeDistributions and distributionIndex\n * @param _prizeDistribution prizeDistribution struct for Draw\n * @param _prizeTierIndex Index of the prize tiers array to calculate\n * @return returns the fraction of the total prize (fixed point 9 number)\n */\n function _calculatePrizeTierFraction(\n IPrizeDistributionBuffer.PrizeDistribution memory _prizeDistribution,\n uint256 _prizeTierIndex\n ) internal pure returns (uint256) {\n // get the prize fraction at that index\n uint256 prizeFraction = _prizeDistribution.tiers[_prizeTierIndex];\n\n // calculate number of prizes for that index\n uint256 numberOfPrizesForIndex = _numberOfPrizesForIndex(\n _prizeDistribution.bitRangeSize,\n _prizeTierIndex\n );\n\n return prizeFraction / numberOfPrizesForIndex;\n }\n\n /**\n * @notice Generates an array of prize tiers fractions\n * @param _prizeDistribution prizeDistribution struct for Draw\n * @param maxWinningTierIndex Max length of the prize tiers array\n * @return returns an array of prize tiers fractions\n */\n function _calculatePrizeTierFractions(\n IPrizeDistributionBuffer.PrizeDistribution memory _prizeDistribution,\n uint8 maxWinningTierIndex\n ) internal pure returns (uint256[] memory) {\n uint256[] memory prizeDistributionFractions = new uint256[](\n maxWinningTierIndex + 1\n );\n\n for (uint8 i = 0; i <= maxWinningTierIndex; i++) {\n prizeDistributionFractions[i] = _calculatePrizeTierFraction(\n _prizeDistribution,\n i\n );\n }\n\n return prizeDistributionFractions;\n }\n\n /**\n * @notice Calculates the number of prizes for a given prizeDistributionIndex\n * @param _bitRangeSize Bit range size for Draw\n * @param _prizeTierIndex Index of the prize tier array to calculate\n * @return returns the fraction of the total prize (base 1e18)\n */\n function _numberOfPrizesForIndex(uint8 _bitRangeSize, uint256 _prizeTierIndex)\n internal\n pure\n returns (uint256)\n {\n if (_prizeTierIndex > 0) {\n return ( 1 << _bitRangeSize * _prizeTierIndex ) - ( 1 << _bitRangeSize * (_prizeTierIndex - 1) );\n } else {\n return 1;\n }\n }\n}\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-core/contracts/DrawCalculator.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-core/contracts/DrawCalculator.sol';\n" + }, + "@pooltogether/v4-core/contracts/DrawBuffer.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\";\n\nimport \"./interfaces/IDrawBuffer.sol\";\nimport \"./interfaces/IDrawBeacon.sol\";\nimport \"./libraries/DrawRingBufferLib.sol\";\n\n/**\n * @title PoolTogether V4 DrawBuffer\n * @author PoolTogether Inc Team\n * @notice The DrawBuffer provides historical lookups of Draws via a circular ring buffer.\n Historical Draws can be accessed on-chain using a drawId to calculate ring buffer storage slot.\n The Draw settings can be created by manager/owner and existing Draws can only be updated the owner.\n Once a starting Draw has been added to the ring buffer, all following draws must have a sequential Draw ID.\n @dev A DrawBuffer store a limited number of Draws before beginning to overwrite (managed via the cardinality) previous Draws.\n @dev All mainnet DrawBuffer(s) are updated directly from a DrawBeacon, but non-mainnet DrawBuffer(s) (Matic, Optimism, Arbitrum, etc...)\n will receive a cross-chain message, duplicating the mainnet Draw configuration - enabling a prize savings liquidity network.\n*/\ncontract DrawBuffer is IDrawBuffer, Manageable {\n using DrawRingBufferLib for DrawRingBufferLib.Buffer;\n\n /// @notice Draws ring buffer max length.\n uint16 public constant MAX_CARDINALITY = 256;\n\n /// @notice Draws ring buffer array.\n IDrawBeacon.Draw[MAX_CARDINALITY] private drawRingBuffer;\n\n /// @notice Holds ring buffer information\n DrawRingBufferLib.Buffer internal bufferMetadata;\n\n /* ============ Deploy ============ */\n\n /**\n * @notice Deploy DrawBuffer smart contract.\n * @param _owner Address of the owner of the DrawBuffer.\n * @param _cardinality Draw ring buffer cardinality.\n */\n constructor(address _owner, uint8 _cardinality) Ownable(_owner) {\n bufferMetadata.cardinality = _cardinality;\n }\n\n /* ============ External Functions ============ */\n\n /// @inheritdoc IDrawBuffer\n function getBufferCardinality() external view override returns (uint32) {\n return bufferMetadata.cardinality;\n }\n\n /// @inheritdoc IDrawBuffer\n function getDraw(uint32 drawId) external view override returns (IDrawBeacon.Draw memory) {\n return drawRingBuffer[_drawIdToDrawIndex(bufferMetadata, drawId)];\n }\n\n /// @inheritdoc IDrawBuffer\n function getDraws(uint32[] calldata _drawIds)\n external\n view\n override\n returns (IDrawBeacon.Draw[] memory)\n {\n IDrawBeacon.Draw[] memory draws = new IDrawBeacon.Draw[](_drawIds.length);\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\n\n for (uint256 index = 0; index < _drawIds.length; index++) {\n draws[index] = drawRingBuffer[_drawIdToDrawIndex(buffer, _drawIds[index])];\n }\n\n return draws;\n }\n\n /// @inheritdoc IDrawBuffer\n function getDrawCount() external view override returns (uint32) {\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\n\n if (buffer.lastDrawId == 0) {\n return 0;\n }\n\n uint32 bufferNextIndex = buffer.nextIndex;\n\n if (drawRingBuffer[bufferNextIndex].timestamp != 0) {\n return buffer.cardinality;\n } else {\n return bufferNextIndex;\n }\n }\n\n /// @inheritdoc IDrawBuffer\n function getNewestDraw() external view override returns (IDrawBeacon.Draw memory) {\n return _getNewestDraw(bufferMetadata);\n }\n\n /// @inheritdoc IDrawBuffer\n function getOldestDraw() external view override returns (IDrawBeacon.Draw memory) {\n // oldest draw should be next available index, otherwise it's at 0\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\n IDrawBeacon.Draw memory draw = drawRingBuffer[buffer.nextIndex];\n\n if (draw.timestamp == 0) {\n // if draw is not init, then use draw at 0\n draw = drawRingBuffer[0];\n }\n\n return draw;\n }\n\n /// @inheritdoc IDrawBuffer\n function pushDraw(IDrawBeacon.Draw memory _draw)\n external\n override\n onlyManagerOrOwner\n returns (uint32)\n {\n return _pushDraw(_draw);\n }\n\n /// @inheritdoc IDrawBuffer\n function setDraw(IDrawBeacon.Draw memory _newDraw) external override onlyOwner returns (uint32) {\n DrawRingBufferLib.Buffer memory buffer = bufferMetadata;\n uint32 index = buffer.getIndex(_newDraw.drawId);\n drawRingBuffer[index] = _newDraw;\n emit DrawSet(_newDraw.drawId, _newDraw);\n return _newDraw.drawId;\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Convert a Draw.drawId to a Draws ring buffer index pointer.\n * @dev The getNewestDraw.drawId() is used to calculate a Draws ID delta position.\n * @param _drawId Draw.drawId\n * @return Draws ring buffer index pointer\n */\n function _drawIdToDrawIndex(DrawRingBufferLib.Buffer memory _buffer, uint32 _drawId)\n internal\n pure\n returns (uint32)\n {\n return _buffer.getIndex(_drawId);\n }\n\n /**\n * @notice Read newest Draw from the draws ring buffer.\n * @dev Uses the lastDrawId to calculate the most recently added Draw.\n * @param _buffer Draw ring buffer\n * @return IDrawBeacon.Draw\n */\n function _getNewestDraw(DrawRingBufferLib.Buffer memory _buffer)\n internal\n view\n returns (IDrawBeacon.Draw memory)\n {\n return drawRingBuffer[_buffer.getIndex(_buffer.lastDrawId)];\n }\n\n /**\n * @notice Push Draw onto draws ring buffer history.\n * @dev Push new draw onto draws list via authorized manager or owner.\n * @param _newDraw IDrawBeacon.Draw\n * @return Draw.drawId\n */\n function _pushDraw(IDrawBeacon.Draw memory _newDraw) internal returns (uint32) {\n DrawRingBufferLib.Buffer memory _buffer = bufferMetadata;\n drawRingBuffer[_buffer.nextIndex] = _newDraw;\n bufferMetadata = _buffer.push(_newDraw.drawId);\n\n emit DrawSet(_newDraw.drawId, _newDraw);\n\n return _newDraw.drawId;\n }\n}\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-core/contracts/DrawBuffer.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-core/contracts/DrawBuffer.sol';\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-core/contracts/Reserve.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-core/contracts/Reserve.sol';\n" + }, + "@pooltogether/v4-core/contracts/permit/EIP2612PermitAndDeposit.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\nimport \"../interfaces/IPrizePool.sol\";\nimport \"../interfaces/ITicket.sol\";\n\n/**\n * @notice Secp256k1 signature values.\n * @param deadline Timestamp at which the signature expires\n * @param v `v` portion of the signature\n * @param r `r` portion of the signature\n * @param s `s` portion of the signature\n */\nstruct Signature {\n uint256 deadline;\n uint8 v;\n bytes32 r;\n bytes32 s;\n}\n\n/**\n * @notice Delegate signature to allow delegation of tickets to delegate.\n * @param delegate Address to delegate the prize pool tickets to\n * @param signature Delegate signature\n */\nstruct DelegateSignature {\n address delegate;\n Signature signature;\n}\n\n/// @title Allows users to approve and deposit EIP-2612 compatible tokens into a prize pool in a single transaction.\n/// @custom:experimental This contract has not been fully audited yet.\ncontract EIP2612PermitAndDeposit {\n using SafeERC20 for IERC20;\n\n /**\n * @notice Permits this contract to spend on a user's behalf and deposits into the prize pool.\n * @dev The `spender` address required by the permit function is the address of this contract.\n * @param _prizePool Address of the prize pool to deposit into\n * @param _amount Amount of tokens to deposit into the prize pool\n * @param _to Address that will receive the tickets\n * @param _permitSignature Permit signature\n * @param _delegateSignature Delegate signature\n */\n function permitAndDepositToAndDelegate(\n IPrizePool _prizePool,\n uint256 _amount,\n address _to,\n Signature calldata _permitSignature,\n DelegateSignature calldata _delegateSignature\n ) external {\n ITicket _ticket = _prizePool.getTicket();\n address _token = _prizePool.getToken();\n\n IERC20Permit(_token).permit(\n msg.sender,\n address(this),\n _amount,\n _permitSignature.deadline,\n _permitSignature.v,\n _permitSignature.r,\n _permitSignature.s\n );\n\n _depositToAndDelegate(\n address(_prizePool),\n _ticket,\n _token,\n _amount,\n _to,\n _delegateSignature\n );\n }\n\n /**\n * @notice Deposits user's token into the prize pool and delegate tickets.\n * @param _prizePool Address of the prize pool to deposit into\n * @param _amount Amount of tokens to deposit into the prize pool\n * @param _to Address that will receive the tickets\n * @param _delegateSignature Delegate signature\n */\n function depositToAndDelegate(\n IPrizePool _prizePool,\n uint256 _amount,\n address _to,\n DelegateSignature calldata _delegateSignature\n ) external {\n ITicket _ticket = _prizePool.getTicket();\n address _token = _prizePool.getToken();\n\n _depositToAndDelegate(\n address(_prizePool),\n _ticket,\n _token,\n _amount,\n _to,\n _delegateSignature\n );\n }\n\n /**\n * @notice Deposits user's token into the prize pool and delegate tickets.\n * @param _prizePool Address of the prize pool to deposit into\n * @param _ticket Address of the ticket minted by the prize pool\n * @param _token Address of the token used to deposit into the prize pool\n * @param _amount Amount of tokens to deposit into the prize pool\n * @param _to Address that will receive the tickets\n * @param _delegateSignature Delegate signature\n */\n function _depositToAndDelegate(\n address _prizePool,\n ITicket _ticket,\n address _token,\n uint256 _amount,\n address _to,\n DelegateSignature calldata _delegateSignature\n ) internal {\n _depositTo(_token, msg.sender, _amount, _prizePool, _to);\n\n Signature memory signature = _delegateSignature.signature;\n\n _ticket.delegateWithSignature(\n _to,\n _delegateSignature.delegate,\n signature.deadline,\n signature.v,\n signature.r,\n signature.s\n );\n }\n\n /**\n * @notice Deposits user's token into the prize pool.\n * @param _token Address of the EIP-2612 token to approve and deposit\n * @param _owner Token owner's address (Authorizer)\n * @param _amount Amount of tokens to deposit\n * @param _prizePool Address of the prize pool to deposit into\n * @param _to Address that will receive the tickets\n */\n function _depositTo(\n address _token,\n address _owner,\n uint256 _amount,\n address _prizePool,\n address _to\n ) internal {\n IERC20(_token).safeTransferFrom(_owner, address(this), _amount);\n IERC20(_token).safeIncreaseAllowance(_prizePool, _amount);\n IPrizePool(_prizePool).depositTo(_to, _amount);\n }\n}\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-core/contracts/permit/EIP2612PermitAndDeposit.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-core/contracts/permit/EIP2612PermitAndDeposit.sol';\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/aave-yield-source/contracts/yield-source/ATokenYieldSource.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/aave-yield-source/contracts/yield-source/ATokenYieldSource.sol';\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-core/contracts/Ticket.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-core/contracts/Ticket.sol';\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-core/contracts/prize-pool/YieldSourcePrizePool.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-core/contracts/prize-pool/YieldSourcePrizePool.sol';\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-twab-delegator/contracts/TWABDelegator.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-twab-delegator/contracts/TWABDelegator.sol';\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-timelocks/contracts/L2TimelockTrigger.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-timelocks/contracts/L2TimelockTrigger.sol';\n" + }, + "@pooltogether/v4-timelocks/contracts/DrawCalculatorTimelock.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity 0.8.6;\n\nimport \"@pooltogether/owner-manager-contracts/contracts/Manageable.sol\";\n\nimport \"./interfaces/IDrawCalculatorTimelock.sol\";\n\n/**\n * @title PoolTogether V4 OracleTimelock\n * @author PoolTogether Inc Team\n * @notice OracleTimelock(s) acts as an intermediary between multiple V4 smart contracts.\n The OracleTimelock is responsible for pushing Draws to a DrawBuffer and routing\n claim requests from a PrizeDistributor to a DrawCalculator. The primary objective is\n to include a \"cooldown\" period for all new Draws. Allowing the correction of a\n maliciously set Draw in the unfortunate event an Owner is compromised.\n*/\ncontract DrawCalculatorTimelock is IDrawCalculatorTimelock, Manageable {\n /* ============ Global Variables ============ */\n\n /// @notice Internal DrawCalculator reference.\n IDrawCalculator internal immutable calculator;\n\n /// @notice Internal Timelock struct reference.\n Timelock internal timelock;\n\n /* ============ Events ============ */\n\n /**\n * @notice Deployed event when the constructor is called\n * @param drawCalculator DrawCalculator address bound to this timelock\n */\n event Deployed(IDrawCalculator indexed drawCalculator);\n\n /* ============ Deploy ============ */\n\n /**\n * @notice Initialize DrawCalculatorTimelockTrigger smart contract.\n * @param _owner Address of the DrawCalculator owner.\n * @param _calculator DrawCalculator address.\n */\n constructor(address _owner, IDrawCalculator _calculator) Ownable(_owner) {\n calculator = _calculator;\n\n emit Deployed(_calculator);\n }\n\n /* ============ External Functions ============ */\n\n /// @inheritdoc IDrawCalculatorTimelock\n function calculate(\n address user,\n uint32[] calldata drawIds,\n bytes calldata data\n ) external view override returns (uint256[] memory, bytes memory) {\n Timelock memory _timelock = timelock;\n\n for (uint256 i = 0; i < drawIds.length; i++) {\n // if draw id matches timelock and not expired, revert\n if (drawIds[i] == _timelock.drawId) {\n _requireTimelockElapsed(_timelock);\n }\n }\n\n return calculator.calculate(user, drawIds, data);\n }\n\n /// @inheritdoc IDrawCalculatorTimelock\n function lock(uint32 _drawId, uint64 _timestamp)\n external\n override\n onlyManagerOrOwner\n returns (bool)\n {\n Timelock memory _timelock = timelock;\n require(_drawId == _timelock.drawId + 1, \"OM/not-drawid-plus-one\");\n\n _requireTimelockElapsed(_timelock);\n timelock = Timelock({ drawId: _drawId, timestamp: _timestamp });\n emit LockedDraw(_drawId, _timestamp);\n\n return true;\n }\n\n /// @inheritdoc IDrawCalculatorTimelock\n function getDrawCalculator() external view override returns (IDrawCalculator) {\n return calculator;\n }\n\n /// @inheritdoc IDrawCalculatorTimelock\n function getTimelock() external view override returns (Timelock memory) {\n return timelock;\n }\n\n /// @inheritdoc IDrawCalculatorTimelock\n function setTimelock(Timelock memory _timelock) external override onlyOwner {\n timelock = _timelock;\n\n emit TimelockSet(_timelock);\n }\n\n /// @inheritdoc IDrawCalculatorTimelock\n function hasElapsed() external view override returns (bool) {\n return _timelockHasElapsed(timelock);\n }\n\n /* ============ Internal Functions ============ */\n\n /**\n * @notice Read global DrawCalculator variable.\n * @return IDrawCalculator\n */\n function _timelockHasElapsed(Timelock memory _timelock) internal view returns (bool) {\n // If the timelock hasn't been initialized, then it's elapsed\n if (_timelock.timestamp == 0) {\n return true;\n }\n\n // Otherwise if the timelock has expired, we're good.\n return (block.timestamp > _timelock.timestamp);\n }\n\n /**\n * @notice Require the timelock \"cooldown\" period has elapsed\n * @param _timelock the Timelock to check\n */\n function _requireTimelockElapsed(Timelock memory _timelock) internal view {\n require(_timelockHasElapsed(_timelock), \"OM/timelock-not-expired\");\n }\n}\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-timelocks/contracts/DrawCalculatorTimelock.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-timelocks/contracts/DrawCalculatorTimelock.sol';\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-timelocks/contracts/BeaconTimelockTrigger.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-timelocks/contracts/BeaconTimelockTrigger.sol';\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/v4-timelocks/contracts/ReceiverTimelockTrigger.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/v4-timelocks/contracts/ReceiverTimelockTrigger.sol';\n" + }, + "contracts/hardhat-dependency-compiler/@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@pooltogether/pooltogether-rng-contracts/contracts/RNGChainlinkV2.sol';\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 2000 + }, + "evmVersion": "berlin", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/history/mainnet.1.7.0.json b/history/mainnet.1.7.0.json new file mode 100644 index 0000000..70f41d1 --- /dev/null +++ b/history/mainnet.1.7.0.json @@ -0,0 +1 @@ +{"name":"PoolTogether V4 Mainnet","version":{"major":1,"minor":7,"patch":0},"tags":{},"contracts":[{"chainId":1,"address":"0x32e8D4c9d1B711BC958d0Ce8D14b41F77Bb03a64","version":{"major":1,"minor":7,"patch":0},"type":"ATokenYieldSource","abi":[{"inputs":[{"internalType":"contract ATokenInterface","name":"_aToken","type":"address"},{"internalType":"contract IAaveIncentivesController","name":"_incentivesController","type":"address"},{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"_lendingPoolAddressesProviderRegistry","type":"address"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAToken","name":"aToken","type":"address"},{"indexed":false,"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"lendingPoolAddressesProviderRegistry","type":"address"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"ATokenYieldSourceInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sponsored","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SuppliedTokenTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TransferredERC20","type":"event"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract ATokenInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approveMaxAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"claimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incentivesController","outputs":[{"internalType":"contract IAaveIncentivesController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lendingPoolAddressesProviderRegistry","outputs":[{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sponsor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"supplyTokenTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x6C04Eeeed2dEFedbC9A0f3f63bf14F39a189F607","version":{"major":1,"minor":7,"patch":0},"type":"BeaconTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x0D33612870cd9A475bBBbB7CC38fC66680dEcAC5","version":{"major":1,"minor":7,"patch":0},"type":"DrawBeacon","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract RNGInterface","name":"_rng","type":"address"},{"internalType":"uint32","name":"_nextDrawId","type":"uint32"},{"internalType":"uint64","name":"_beaconPeriodStart","type":"uint64"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint32","name":"_rngTimeout","type":"uint32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"drawPeriodSeconds","type":"uint32"}],"name":"BeaconPeriodSecondsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"startedAt","type":"uint64"}],"name":"BeaconPeriodStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"nextDrawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"newDrawBuffer","type":"address"}],"name":"DrawBufferUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"rngRequestId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"rngLockBlock","type":"uint32"}],"name":"DrawCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"DrawCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"rngRequestId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"rngLockBlock","type":"uint32"}],"name":"DrawStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract RNGInterface","name":"rngService","type":"address"}],"name":"RngServiceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"rngTimeout","type":"uint32"}],"name":"RngTimeoutSet","type":"event"},{"inputs":[],"name":"beaconPeriodEndAt","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beaconPeriodRemainingSeconds","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_time","type":"uint64"}],"name":"calculateNextBeaconPeriodStartTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculateNextBeaconPeriodStartTimeFromCurrentTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canCompleteDraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canStartDraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"completeDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBeaconPeriodSeconds","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBeaconPeriodStartedAt","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRngLockBlock","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRngRequestId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRngService","outputs":[{"internalType":"contract RNGInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRngTimeout","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isBeaconPeriodOver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngCompleted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngRequested","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngTimedOut","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"}],"name":"setBeaconPeriodSeconds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawBuffer","name":"newDrawBuffer","type":"address"}],"name":"setDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract RNGInterface","name":"_rngService","type":"address"}],"name":"setRngService","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_rngTimeout","type":"uint32"}],"name":"setRngTimeout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x78Ea5a9595279DC2F9608283875571b1151F19D4","version":{"major":1,"minor":7,"patch":0},"type":"DrawBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"}],"name":"DrawSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_CARDINALITY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getDraws","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"}],"name":"pushDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_newDraw","type":"tuple"}],"name":"setDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x14d0675580C7255043a3AeD3726F5D7f33292730","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculator","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract PrizeDistributor","name":"prizeDistributor","type":"address"}],"name":"PrizeDistributorSet","type":"event"},{"inputs":[],"name":"TIERS_LENGTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_pickIndicesForDraws","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getNormalizedBalancesForDrawIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x1DcaD946D10343cc4494D610d6273153FB071772","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculatorTimelock","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawCalculator","name":"_calculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"drawCalculator","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"LockedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"indexed":false,"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"timelock","type":"tuple"}],"name":"TimelockSet","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint32[]","name":"drawIds","type":"uint32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimelock","outputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasElapsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint64","name":"_timestamp","type":"uint64"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"_timelock","type":"tuple"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xdC90a79fcb1DBAd5F05E6C264F84AC4b0d351F94","version":{"major":1,"minor":7,"patch":0},"type":"L1TimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionPushed","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xf025a8d9E6080F885e841C8cC0E324368D7C6577","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"cardinality","type":"uint8"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeDistributions","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"pushPrizeDistribution","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"setPrizeDistribution","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x35A0dF72E1ea94B52F9EbE0D515928eCb663f39F","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionFactory","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeTierHistory","name":"_prizeTierHistory","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_minPickCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"calculatePrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint64","name":"_drawTimestamp","type":"uint64"}],"name":"calculatePrizeDistributionWithDrawData","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPickCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeTierHistory","outputs":[{"internalType":"contract IPrizeTierHistory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"pushPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"setPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xb9a179DcA5a7bf5f8B9E088437B3A85ebB495eFe","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributor","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IDrawCalculator","name":"_drawCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"ClaimedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"calculator","type":"address"}],"name":"DrawCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TokenSet","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getDrawPayoutBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawCalculator","name":"_newCalculator","type":"address"}],"name":"setDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x2193b28b2BdfBf805506C9D91Ed2021bA6fBc888","version":{"major":1,"minor":7,"patch":0},"type":"PrizeFlush","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":true,"internalType":"contract IReserve","name":"reserve","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"DestinationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Flushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IReserve","name":"reserve","type":"address"}],"name":"ReserveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"StrategySet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_destination","type":"address"}],"name":"setDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"name":"setReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStrategy","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x47a5ABfAcDebf5af312B034B3b748935A0259136","version":{"major":1,"minor":7,"patch":0},"type":"PrizeSplitStrategy","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IPrizePool","name":"prizePool","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalPrizeCaptured","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeAwarded","type":"uint256"},{"indexed":true,"internalType":"contract IControlledToken","name":"token","type":"address"}],"name":"PrizeSplitAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"target","type":"uint256"}],"name":"PrizeSplitRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint16","name":"percentage","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"PrizeSplitSet","type":"event"},{"inputs":[],"name":"ONE_AS_FIXED_POINT_3","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPrizePool","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizeSplitIndex","type":"uint256"}],"name":"getPrizeSplit","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeSplits","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"_prizeSplit","type":"tuple"},{"internalType":"uint8","name":"_prizeSplitIndex","type":"uint8"}],"name":"setPrizeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"_newPrizeSplits","type":"tuple[]"}],"name":"setPrizeSplits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x24C3e15BdC10Ce2CB1BEc56cd43F397cE9B89430","version":{"major":1,"minor":7,"patch":0},"type":"PrizeTierHistory","abi":[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getPrizeTier","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPrizeTierAtIndex","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeTierList","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"popAndPush","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"nextPrizeTier","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"replace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x3A06B40C67515cda47E44b57116488F73A441F72","version":{"major":1,"minor":7,"patch":0},"type":"RNGChainlinkV2","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract VRFCoordinatorV2Interface","name":"_vrfCoordinator","type":"address"},{"internalType":"uint64","name":"_subscriptionId","type":"uint64"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"keyHash","type":"bytes32"}],"name":"KeyHashSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"requestId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"RandomNumberCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"requestId","type":"uint32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RandomNumberRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"subscriptionId","type":"uint64"}],"name":"SubscriptionIdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract VRFCoordinatorV2Interface","name":"vrfCoordinator","type":"address"}],"name":"VrfCoordinatorSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getKeyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRequestId","outputs":[{"internalType":"uint32","name":"requestId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRequestFee","outputs":[{"internalType":"address","name":"feeToken","type":"address"},{"internalType":"uint256","name":"requestFee","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getSubscriptionId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVrfCoordinator","outputs":[{"internalType":"contract VRFCoordinatorV2Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_internalRequestId","type":"uint32"}],"name":"isRequestComplete","outputs":[{"internalType":"bool","name":"isCompleted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_internalRequestId","type":"uint32"}],"name":"randomNumber","outputs":[{"internalType":"uint256","name":"randomNum","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestRandomNumber","outputs":[{"internalType":"uint32","name":"requestId","type":"uint32"},{"internalType":"uint32","name":"lockBlock","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"name":"setKeyhash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_subscriptionId","type":"uint64"}],"name":"setSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xadB4D93D84b18b5D82063aCf58b21587c92fdfb5","version":{"major":1,"minor":7,"patch":0},"type":"Reserve","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserveAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAccumulated","type":"uint256"}],"name":"Checkpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"getReserveAccumulatedBetween","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAccumulator","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0x5cFbEE38362B9A60be276763753f64245EA990F7","version":{"major":1,"minor":7,"patch":0},"type":"TWABDelegator","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegateeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"contract Delegation","name":"delegation","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegationCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFundedFromStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"RepresentativeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDelegation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WithdrewDelegationToStake","type":"event"},{"inputs":[],"name":"MAX_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"computeDelegationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"createDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationInstance","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegationFromStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"getDelegation","outputs":[{"internalType":"contract Delegation","name":"delegation","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"},{"internalType":"bool","name":"wasCreated","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"address","name":"_representative","type":"address"}],"name":"isRepresentativeOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitAndMulticall.Signature","name":"_permitSignature","type":"tuple"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"permitAndMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_representative","type":"address"},{"internalType":"bool","name":"_set","type":"bool"}],"name":"setRepresentative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferDelegationTo","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"updateDelegatee","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawDelegationToStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xdd4d117723C257CEe402285D3aCF218E9A8236E1","version":{"major":1,"minor":7,"patch":0},"type":"Ticket","abi":[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegate","type":"address"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTotalSupplyTwab","type":"tuple"}],"name":"NewTotalSupplyTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTwab","type":"tuple"}],"name":"NewUserTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"TicketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"controllerDelegateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"delegateOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_newDelegate","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"delegateWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAccountDetails","outputs":[{"components":[{"internalType":"uint208","name":"balance","type":"uint208"},{"internalType":"uint24","name":"nextTwabIndex","type":"uint24"},{"internalType":"uint24","name":"cardinality","type":"uint24"}],"internalType":"struct TwabLib.AccountDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_startTime","type":"uint64"},{"internalType":"uint64","name":"_endTime","type":"uint64"}],"name":"getAverageBalanceBetween","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageBalancesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageTotalSuppliesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getBalanceAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getBalancesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getTotalSuppliesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getTotalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"getTwab","outputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct ObservationLib.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xe7934EE0c8b877269A5688ee26dd853785212618","version":{"major":1,"minor":7,"patch":0},"type":"TwabRewards","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"}],"name":"PromotionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PromotionDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"epochNumber","type":"uint8"}],"name":"PromotionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"PromotionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint8[]","name":"epochIds","type":"uint8[]"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint256","name":"_tokensPerEpoch","type":"uint256"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"createPromotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"destroyPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"endPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"extendPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getCurrentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getPromotion","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint8","name":"numberOfEpochs","type":"uint8"},{"internalType":"uint48","name":"epochDuration","type":"uint48"},{"internalType":"uint48","name":"createdAt","type":"uint48"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokensPerEpoch","type":"uint256"},{"internalType":"uint256","name":"rewardsUnclaimed","type":"uint256"}],"internalType":"struct ITwabRewards.Promotion","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getRemainingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"getRewardsAmount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":1,"address":"0xd89a09084555a7D0ABe7B111b1f78DFEdDd638Be","version":{"major":1,"minor":7,"patch":0},"type":"YieldSourcePrizePool","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IYieldSource","name":"_yieldSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Awarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardedExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balanceCap","type":"uint256"}],"name":"BalanceCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"}],"name":"ControlledTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"yieldSource","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"liquidityCap","type":"uint256"}],"name":"LiquidityCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prizeStrategy","type":"address"}],"name":"PrizeStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferredExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemed","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"award","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"awardExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"awardExternalERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_externalToken","type":"address"}],"name":"canAwardExternal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureAwardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICompLike","name":"_compLike","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"compLikeDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_delegate","type":"address"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccountedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_controlledToken","type":"address"}],"name":"isControlled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balanceCap","type":"uint256"}],"name":"setBalanceCap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityCap","type":"uint256"}],"name":"setLiquidityCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prizeStrategy","type":"address"}],"name":"setPrizeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"name":"setTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldSource","outputs":[{"internalType":"contract IYieldSource","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xD4F6d570133401079D213EcF4A14FA0B4bfB5b9C","version":{"major":1,"minor":7,"patch":0},"type":"ATokenYieldSource","abi":[{"inputs":[{"internalType":"contract ATokenInterface","name":"_aToken","type":"address"},{"internalType":"contract IAaveIncentivesController","name":"_incentivesController","type":"address"},{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"_lendingPoolAddressesProviderRegistry","type":"address"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAToken","name":"aToken","type":"address"},{"indexed":false,"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"lendingPoolAddressesProviderRegistry","type":"address"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"ATokenYieldSourceInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sponsored","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SuppliedTokenTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TransferredERC20","type":"event"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract ATokenInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approveMaxAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"claimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incentivesController","outputs":[{"internalType":"contract IAaveIncentivesController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lendingPoolAddressesProviderRegistry","outputs":[{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sponsor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"supplyTokenTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x94f23320ac3Ed351782791506266351eb4183e8d","version":{"major":1,"minor":7,"patch":0},"type":"BeaconTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x52325504bD35aeC31D842F62A113E9e4b665d885","version":{"major":1,"minor":7,"patch":0},"type":"DrawBeacon","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract RNGInterface","name":"_rng","type":"address"},{"internalType":"uint32","name":"_nextDrawId","type":"uint32"},{"internalType":"uint64","name":"_beaconPeriodStart","type":"uint64"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint32","name":"_rngTimeout","type":"uint32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"drawPeriodSeconds","type":"uint32"}],"name":"BeaconPeriodSecondsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"startedAt","type":"uint64"}],"name":"BeaconPeriodStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"nextDrawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"newDrawBuffer","type":"address"}],"name":"DrawBufferUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"rngRequestId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"rngLockBlock","type":"uint32"}],"name":"DrawCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"DrawCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"rngRequestId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"rngLockBlock","type":"uint32"}],"name":"DrawStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract RNGInterface","name":"rngService","type":"address"}],"name":"RngServiceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"rngTimeout","type":"uint32"}],"name":"RngTimeoutSet","type":"event"},{"inputs":[],"name":"beaconPeriodEndAt","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beaconPeriodRemainingSeconds","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_time","type":"uint64"}],"name":"calculateNextBeaconPeriodStartTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculateNextBeaconPeriodStartTimeFromCurrentTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canCompleteDraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canStartDraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"completeDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBeaconPeriodSeconds","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBeaconPeriodStartedAt","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRngLockBlock","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRngRequestId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRngService","outputs":[{"internalType":"contract RNGInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRngTimeout","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isBeaconPeriodOver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngCompleted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngRequested","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRngTimedOut","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"}],"name":"setBeaconPeriodSeconds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawBuffer","name":"newDrawBuffer","type":"address"}],"name":"setDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract RNGInterface","name":"_rngService","type":"address"}],"name":"setRngService","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_rngTimeout","type":"uint32"}],"name":"setRngTimeout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x44B1d66E7B9d4467139924f31754F34cbC392f44","version":{"major":1,"minor":7,"patch":0},"type":"DrawBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"}],"name":"DrawSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_CARDINALITY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getDraws","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"}],"name":"pushDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_newDraw","type":"tuple"}],"name":"setDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x3976BD6F4B82C97314570A77bc1e979f7A839A24","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculator","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract PrizeDistributor","name":"prizeDistributor","type":"address"}],"name":"PrizeDistributorSet","type":"event"},{"inputs":[],"name":"TIERS_LENGTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_pickIndicesForDraws","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getNormalizedBalancesForDrawIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x0C22044B0aA634e26C5B5e50E2B958C7aF59c161","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculatorTimelock","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawCalculator","name":"_calculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"drawCalculator","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"LockedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"indexed":false,"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"timelock","type":"tuple"}],"name":"TimelockSet","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint32[]","name":"drawIds","type":"uint32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimelock","outputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasElapsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint64","name":"_timestamp","type":"uint64"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"_timelock","type":"tuple"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xc366bF1a054CA495c09B1A722D863ac65746138E","version":{"major":1,"minor":7,"patch":0},"type":"L2TimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"DrawAndPrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xcf6030BDEaB4E503D186426510aD88C1DA7125A3","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"cardinality","type":"uint8"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeDistributions","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"pushPrizeDistribution","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"setPrizeDistribution","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x38004713B1793f00c5B497E3eCC1a50697e5FfaE","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionFactory","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeTierHistory","name":"_prizeTierHistory","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_minPickCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"calculatePrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint64","name":"_drawTimestamp","type":"uint64"}],"name":"calculatePrizeDistributionWithDrawData","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPickCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeTierHistory","outputs":[{"internalType":"contract IPrizeTierHistory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"pushPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"setPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x8141BcFBcEE654c5dE17C4e2B2AF26B67f9B9056","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributor","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IDrawCalculator","name":"_drawCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"ClaimedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"calculator","type":"address"}],"name":"DrawCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TokenSet","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getDrawPayoutBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawCalculator","name":"_newCalculator","type":"address"}],"name":"setDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xA2342489470474536F04cd4DdA2e8658303b305d","version":{"major":1,"minor":7,"patch":0},"type":"PrizeFlush","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":true,"internalType":"contract IReserve","name":"reserve","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"DestinationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Flushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IReserve","name":"reserve","type":"address"}],"name":"ReserveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"StrategySet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_destination","type":"address"}],"name":"setDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"name":"setReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStrategy","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x879e176Ae9Fe9B00c30f4827364eA9e4fB35858D","version":{"major":1,"minor":7,"patch":0},"type":"PrizeSplitStrategy","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IPrizePool","name":"prizePool","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalPrizeCaptured","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeAwarded","type":"uint256"},{"indexed":true,"internalType":"contract IControlledToken","name":"token","type":"address"}],"name":"PrizeSplitAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"target","type":"uint256"}],"name":"PrizeSplitRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint16","name":"percentage","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"PrizeSplitSet","type":"event"},{"inputs":[],"name":"ONE_AS_FIXED_POINT_3","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPrizePool","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizeSplitIndex","type":"uint256"}],"name":"getPrizeSplit","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeSplits","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"_prizeSplit","type":"tuple"},{"internalType":"uint8","name":"_prizeSplitIndex","type":"uint8"}],"name":"setPrizeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"_newPrizeSplits","type":"tuple[]"}],"name":"setPrizeSplits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x1DcaD946D10343cc4494D610d6273153FB071772","version":{"major":1,"minor":7,"patch":0},"type":"PrizeTierHistory","abi":[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getPrizeTier","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPrizeTierAtIndex","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeTierList","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"popAndPush","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"nextPrizeTier","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"replace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x7402d9f36904894273B31dD0d998D826c833EF93","version":{"major":1,"minor":7,"patch":0},"type":"RNGChainlinkV2","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract VRFCoordinatorV2Interface","name":"_vrfCoordinator","type":"address"},{"internalType":"uint64","name":"_subscriptionId","type":"uint64"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"keyHash","type":"bytes32"}],"name":"KeyHashSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"requestId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"RandomNumberCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"requestId","type":"uint32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RandomNumberRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"subscriptionId","type":"uint64"}],"name":"SubscriptionIdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract VRFCoordinatorV2Interface","name":"vrfCoordinator","type":"address"}],"name":"VrfCoordinatorSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getKeyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastRequestId","outputs":[{"internalType":"uint32","name":"requestId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRequestFee","outputs":[{"internalType":"address","name":"feeToken","type":"address"},{"internalType":"uint256","name":"requestFee","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getSubscriptionId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVrfCoordinator","outputs":[{"internalType":"contract VRFCoordinatorV2Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_internalRequestId","type":"uint32"}],"name":"isRequestComplete","outputs":[{"internalType":"bool","name":"isCompleted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_internalRequestId","type":"uint32"}],"name":"randomNumber","outputs":[{"internalType":"uint256","name":"randomNum","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestRandomNumber","outputs":[{"internalType":"uint32","name":"requestId","type":"uint32"},{"internalType":"uint32","name":"lockBlock","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"name":"setKeyhash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_subscriptionId","type":"uint64"}],"name":"setSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x0F3137E09349449b62144f0918135dE548FdFeeE","version":{"major":1,"minor":7,"patch":0},"type":"ReceiverTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedPushedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0xCE148f6acFee9FEFb42A736B4976e657f35982b8","version":{"major":1,"minor":7,"patch":0},"type":"Reserve","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserveAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAccumulated","type":"uint256"}],"name":"Checkpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"getReserveAccumulatedBetween","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAccumulator","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x89Ee77Ce3F4C1b0346FF96E3004ff7C9f972dEF8","version":{"major":1,"minor":7,"patch":0},"type":"TWABDelegator","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegateeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"contract Delegation","name":"delegation","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegationCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFundedFromStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"RepresentativeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDelegation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WithdrewDelegationToStake","type":"event"},{"inputs":[],"name":"MAX_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"computeDelegationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"createDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationInstance","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegationFromStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"getDelegation","outputs":[{"internalType":"contract Delegation","name":"delegation","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"},{"internalType":"bool","name":"wasCreated","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"address","name":"_representative","type":"address"}],"name":"isRepresentativeOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitAndMulticall.Signature","name":"_permitSignature","type":"tuple"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"permitAndMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_representative","type":"address"},{"internalType":"bool","name":"_set","type":"bool"}],"name":"setRepresentative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferDelegationTo","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"updateDelegatee","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawDelegationToStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x6a304dFdb9f808741244b6bfEe65ca7B3b3A6076","version":{"major":1,"minor":7,"patch":0},"type":"Ticket","abi":[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegate","type":"address"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTotalSupplyTwab","type":"tuple"}],"name":"NewTotalSupplyTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTwab","type":"tuple"}],"name":"NewUserTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"TicketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"controllerDelegateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"delegateOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_newDelegate","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"delegateWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAccountDetails","outputs":[{"components":[{"internalType":"uint208","name":"balance","type":"uint208"},{"internalType":"uint24","name":"nextTwabIndex","type":"uint24"},{"internalType":"uint24","name":"cardinality","type":"uint24"}],"internalType":"struct TwabLib.AccountDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_startTime","type":"uint64"},{"internalType":"uint64","name":"_endTime","type":"uint64"}],"name":"getAverageBalanceBetween","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageBalancesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageTotalSuppliesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getBalanceAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getBalancesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getTotalSuppliesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getTotalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"getTwab","outputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct ObservationLib.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x1470c87e2db5247A36C60DE3D65D7C972C62EA0f","version":{"major":1,"minor":7,"patch":0},"type":"TwabRewards","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"}],"name":"PromotionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PromotionDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"epochNumber","type":"uint8"}],"name":"PromotionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"PromotionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint8[]","name":"epochIds","type":"uint8[]"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint256","name":"_tokensPerEpoch","type":"uint256"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"createPromotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"destroyPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"endPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"extendPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getCurrentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getPromotion","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint8","name":"numberOfEpochs","type":"uint8"},{"internalType":"uint48","name":"epochDuration","type":"uint48"},{"internalType":"uint48","name":"createdAt","type":"uint48"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokensPerEpoch","type":"uint256"},{"internalType":"uint256","name":"rewardsUnclaimed","type":"uint256"}],"internalType":"struct ITwabRewards.Promotion","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getRemainingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"getRewardsAmount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":137,"address":"0x19DE635fb3678D8B8154E37d8C9Cdf182Fe84E60","version":{"major":1,"minor":7,"patch":0},"type":"YieldSourcePrizePool","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IYieldSource","name":"_yieldSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Awarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardedExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balanceCap","type":"uint256"}],"name":"BalanceCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"}],"name":"ControlledTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"yieldSource","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"liquidityCap","type":"uint256"}],"name":"LiquidityCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prizeStrategy","type":"address"}],"name":"PrizeStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferredExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemed","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"award","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"awardExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"awardExternalERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_externalToken","type":"address"}],"name":"canAwardExternal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureAwardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICompLike","name":"_compLike","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"compLikeDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_delegate","type":"address"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccountedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_controlledToken","type":"address"}],"name":"isControlled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balanceCap","type":"uint256"}],"name":"setBalanceCap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityCap","type":"uint256"}],"name":"setLiquidityCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prizeStrategy","type":"address"}],"name":"setPrizeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"name":"setTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldSource","outputs":[{"internalType":"contract IYieldSource","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x7437db21A0dEB844Fa64223e2d6Db569De9648Ff","version":{"major":1,"minor":7,"patch":0},"type":"ATokenYieldSource","abi":[{"inputs":[{"internalType":"contract ATokenInterface","name":"_aToken","type":"address"},{"internalType":"contract IAaveIncentivesController","name":"_incentivesController","type":"address"},{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"_lendingPoolAddressesProviderRegistry","type":"address"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAToken","name":"aToken","type":"address"},{"indexed":false,"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"lendingPoolAddressesProviderRegistry","type":"address"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"ATokenYieldSourceInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sponsored","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SuppliedTokenTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TransferredERC20","type":"event"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract ATokenInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approveMaxAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"claimRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incentivesController","outputs":[{"internalType":"contract IAaveIncentivesController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lendingPoolAddressesProviderRegistry","outputs":[{"internalType":"contract ILendingPoolAddressesProviderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sponsor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"supplyTokenTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x31bCAF169D25f938A25c2e4C762f3D1D3FA7dB2E","version":{"major":1,"minor":7,"patch":0},"type":"DrawBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"}],"name":"DrawSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_CARDINALITY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getDraws","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"}],"name":"pushDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_newDraw","type":"tuple"}],"name":"setDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x0F5F5EF16465371152fC46C72D06fb0ec9392a47","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculator","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract PrizeDistributor","name":"prizeDistributor","type":"address"}],"name":"PrizeDistributorSet","type":"event"},{"inputs":[],"name":"TIERS_LENGTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_pickIndicesForDraws","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getNormalizedBalancesForDrawIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x01eE1Ea692773f28c45D63133426f21923C3c2Ba","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculatorTimelock","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawCalculator","name":"_calculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"drawCalculator","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"LockedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"indexed":false,"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"timelock","type":"tuple"}],"name":"TimelockSet","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint32[]","name":"drawIds","type":"uint32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimelock","outputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasElapsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint64","name":"_timestamp","type":"uint64"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"_timelock","type":"tuple"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xC660A8De5eB9E123E475Ae9A9f62dB62c92a3648","version":{"major":1,"minor":7,"patch":0},"type":"EIP2612PermitAndDeposit","abi":[{"inputs":[{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"components":[{"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"internalType":"struct DelegateSignature","name":"_delegateSignature","type":"tuple"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"_permitSignature","type":"tuple"},{"components":[{"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"internalType":"struct DelegateSignature","name":"_delegateSignature","type":"tuple"}],"name":"permitAndDepositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xC8faa39E06ddB8362cb8E3FFDAdeB5bF7877ECcb","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"cardinality","type":"uint8"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeDistributions","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"pushPrizeDistribution","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionBuffer.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"setPrizeDistribution","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x87FCF371D68d2429D57Bf1BadcBEEc3463F0DD37","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionFactory","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeTierHistory","name":"_prizeTierHistory","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_minPickCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"calculatePrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint64","name":"_drawTimestamp","type":"uint64"}],"name":"calculatePrizeDistributionWithDrawData","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPickCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeTierHistory","outputs":[{"internalType":"contract IPrizeTierHistory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"pushPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"setPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x83332F908f403ce795D90f677cE3f382FE73f3D1","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributor","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IDrawCalculator","name":"_drawCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"ClaimedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"calculator","type":"address"}],"name":"DrawCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TokenSet","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getDrawPayoutBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawCalculator","name":"_newCalculator","type":"address"}],"name":"setDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x1B20994C3894EcC862e26A9F4EC626A8489DD051","version":{"major":1,"minor":7,"patch":0},"type":"PrizeFlush","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":true,"internalType":"contract IReserve","name":"reserve","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"DestinationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Flushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IReserve","name":"reserve","type":"address"}],"name":"ReserveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"StrategySet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_destination","type":"address"}],"name":"setDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"name":"setReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStrategy","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xA30cB2A488dc616F060a54Ee7971d0bD832547Ec","version":{"major":1,"minor":7,"patch":0},"type":"PrizeSplitStrategy","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IPrizePool","name":"prizePool","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalPrizeCaptured","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeAwarded","type":"uint256"},{"indexed":true,"internalType":"contract IControlledToken","name":"token","type":"address"}],"name":"PrizeSplitAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"target","type":"uint256"}],"name":"PrizeSplitRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint16","name":"percentage","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"PrizeSplitSet","type":"event"},{"inputs":[],"name":"ONE_AS_FIXED_POINT_3","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPrizePool","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizeSplitIndex","type":"uint256"}],"name":"getPrizeSplit","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeSplits","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"_prizeSplit","type":"tuple"},{"internalType":"uint8","name":"_prizeSplitIndex","type":"uint8"}],"name":"setPrizeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"_newPrizeSplits","type":"tuple[]"}],"name":"setPrizeSplits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xC3DAD539E460103c860Bb9Ca547647EDbD4903b6","version":{"major":1,"minor":7,"patch":0},"type":"PrizeTierHistory","abi":[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getPrizeTier","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPrizeTierAtIndex","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeTierList","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"popAndPush","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"nextPrizeTier","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"replace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x832cB306640dD33542dBa08ca1c13DD6686A3a88","version":{"major":1,"minor":7,"patch":0},"type":"ReceiverTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedPushedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xf04E5B81e69Cdc3c08BC5Da64ca053AD46a3d029","version":{"major":1,"minor":7,"patch":0},"type":"Reserve","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserveAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAccumulated","type":"uint256"}],"name":"Checkpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"getReserveAccumulatedBetween","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAccumulator","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xd23723fef8A16B77eaDc1fC822aE4170bA9d4009","version":{"major":1,"minor":7,"patch":0},"type":"TWABDelegator","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegateeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"contract Delegation","name":"delegation","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegationCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFundedFromStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"RepresentativeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDelegation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WithdrewDelegationToStake","type":"event"},{"inputs":[],"name":"MAX_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"computeDelegationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"createDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationInstance","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegationFromStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"getDelegation","outputs":[{"internalType":"contract Delegation","name":"delegation","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"},{"internalType":"bool","name":"wasCreated","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"address","name":"_representative","type":"address"}],"name":"isRepresentativeOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitAndMulticall.Signature","name":"_permitSignature","type":"tuple"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"permitAndMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_representative","type":"address"},{"internalType":"bool","name":"_set","type":"bool"}],"name":"setRepresentative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferDelegationTo","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"updateDelegatee","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawDelegationToStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xB27f379C050f6eD0973A01667458af6eCeBc1d90","version":{"major":1,"minor":7,"patch":0},"type":"Ticket","abi":[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegate","type":"address"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTotalSupplyTwab","type":"tuple"}],"name":"NewTotalSupplyTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTwab","type":"tuple"}],"name":"NewUserTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"TicketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"controllerDelegateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"delegateOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_newDelegate","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"delegateWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAccountDetails","outputs":[{"components":[{"internalType":"uint208","name":"balance","type":"uint208"},{"internalType":"uint24","name":"nextTwabIndex","type":"uint24"},{"internalType":"uint24","name":"cardinality","type":"uint24"}],"internalType":"struct TwabLib.AccountDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_startTime","type":"uint64"},{"internalType":"uint64","name":"_endTime","type":"uint64"}],"name":"getAverageBalanceBetween","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageBalancesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageTotalSuppliesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getBalanceAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getBalancesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getTotalSuppliesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getTotalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"getTwab","outputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct ObservationLib.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0x01A1F0699356afeB850f5A80226C35A9319CAf74","version":{"major":1,"minor":7,"patch":0},"type":"TwabRewards","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"}],"name":"PromotionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PromotionDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"epochNumber","type":"uint8"}],"name":"PromotionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"PromotionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint8[]","name":"epochIds","type":"uint8[]"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint256","name":"_tokensPerEpoch","type":"uint256"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"createPromotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"destroyPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"endPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"extendPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getCurrentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getPromotion","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint8","name":"numberOfEpochs","type":"uint8"},{"internalType":"uint48","name":"epochDuration","type":"uint48"},{"internalType":"uint48","name":"createdAt","type":"uint48"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokensPerEpoch","type":"uint256"},{"internalType":"uint256","name":"rewardsUnclaimed","type":"uint256"}],"internalType":"struct ITwabRewards.Promotion","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getRemainingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"getRewardsAmount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":43114,"address":"0xF830F5Cb2422d555EC34178E27094a816c8F95EC","version":{"major":1,"minor":7,"patch":0},"type":"YieldSourcePrizePool","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IYieldSource","name":"_yieldSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Awarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardedExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balanceCap","type":"uint256"}],"name":"BalanceCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"}],"name":"ControlledTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"yieldSource","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"liquidityCap","type":"uint256"}],"name":"LiquidityCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prizeStrategy","type":"address"}],"name":"PrizeStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferredExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemed","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"award","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"awardExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"awardExternalERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_externalToken","type":"address"}],"name":"canAwardExternal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureAwardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICompLike","name":"_compLike","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"compLikeDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_delegate","type":"address"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccountedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_controlledToken","type":"address"}],"name":"isControlled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balanceCap","type":"uint256"}],"name":"setBalanceCap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityCap","type":"uint256"}],"name":"setLiquidityCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prizeStrategy","type":"address"}],"name":"setPrizeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"name":"setTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldSource","outputs":[{"internalType":"contract IYieldSource","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x4ecB5300D9ec6BCA09d66bfd8Dcb532e3192dDA1","version":{"major":1,"minor":7,"patch":0},"type":"AaveV3YieldSource","abi":[{"inputs":[{"internalType":"contract IAToken","name":"_aToken","type":"address"},{"internalType":"contract IRewardsController","name":"_rewardsController","type":"address"},{"internalType":"contract IPoolAddressesProviderRegistry","name":"_poolAddressesProviderRegistry","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAToken","name":"aToken","type":"address"},{"indexed":false,"internalType":"contract IRewardsController","name":"rewardsController","type":"address"},{"indexed":false,"internalType":"contract IPoolAddressesProviderRegistry","name":"poolAddressesProviderRegistry","type":"address"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"AaveV3YieldSourceInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address[]","name":"rewardsList","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"claimedAmounts","type":"uint256[]"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"DecreasedERC20Allowance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"IncreasedERC20Allowance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SuppliedTokenTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TransferredERC20","type":"event"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract IAToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"balanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"decreaseERC20Allowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"increaseERC20Allowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolAddressesProviderRegistry","outputs":[{"internalType":"contract IPoolAddressesProviderRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_redeemAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsController","outputs":[{"internalType":"contract IRewardsController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_depositAmount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"supplyTokenTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x267DD4034830Bb4ba9314e0471C1dDFD79849777","version":{"major":1,"minor":7,"patch":0},"type":"DrawBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"}],"name":"DrawSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_CARDINALITY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getDraws","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDraw","outputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"}],"name":"pushDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_newDraw","type":"tuple"}],"name":"setDraw","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x46d2f8e4D8Ff3d76cf252D89dD9b422f04123D2c","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculator","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"},{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionBuffer","name":"prizeDistributionBuffer","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract PrizeDistributor","name":"prizeDistributor","type":"address"}],"name":"PrizeDistributorSet","type":"event"},{"inputs":[],"name":"TIERS_LENGTH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_pickIndicesForDraws","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDrawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getNormalizedBalancesForDrawIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0xd23723fef8A16B77eaDc1fC822aE4170bA9d4009","version":{"major":1,"minor":7,"patch":0},"type":"DrawCalculatorTimelock","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawCalculator","name":"_calculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"drawCalculator","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"LockedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"indexed":false,"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"timelock","type":"tuple"}],"name":"TimelockSet","type":"event"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint32[]","name":"drawIds","type":"uint32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"calculate","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimelock","outputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasElapsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint64","name":"_timestamp","type":"uint64"}],"name":"lock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"internalType":"struct IDrawCalculatorTimelock.Timelock","name":"_timelock","type":"tuple"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0xcddfa3BfC0e548d9A526E3355FefDf987F4e1aAE","version":{"major":1,"minor":7,"patch":0},"type":"EIP2612PermitAndDeposit","abi":[{"inputs":[{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"components":[{"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"internalType":"struct DelegateSignature","name":"_delegateSignature","type":"tuple"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"_permitSignature","type":"tuple"},{"components":[{"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"internalType":"struct DelegateSignature","name":"_delegateSignature","type":"tuple"}],"name":"permitAndDepositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x8e4F3098192948E342fB11ED7C4a23CD5A306973","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionBuffer","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_cardinality","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"cardinality","type":"uint8"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"indexed":false,"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"prizeDistribution","type":"tuple"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBufferCardinality","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"prizeDistribution","type":"tuple"},{"internalType":"uint32","name":"drawId","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeDistributionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeDistributions","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"pushPrizeDistribution","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"_prizeDistribution","type":"tuple"}],"name":"setPrizeDistribution","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x01A1F0699356afeB850f5A80226C35A9319CAf74","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributionFactory","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizeTierHistory","name":"_prizeTierHistory","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionBuffer","name":"_prizeDistributionBuffer","type":"address"},{"internalType":"contract ITicket","name":"_ticket","type":"address"},{"internalType":"uint256","name":"_minPickCost","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"PrizeDistributionSet","type":"event"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"calculatePrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"},{"internalType":"uint32","name":"_beaconPeriodSeconds","type":"uint32"},{"internalType":"uint64","name":"_drawTimestamp","type":"uint64"}],"name":"calculatePrizeDistributionWithDrawData","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPickCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionBuffer","outputs":[{"internalType":"contract IPrizeDistributionBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeTierHistory","outputs":[{"internalType":"contract IPrizeTierHistory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"pushPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_drawId","type":"uint32"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"setPrizeDistribution","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint8","name":"matchCardinality","type":"uint8"},{"internalType":"uint32","name":"startTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint104","name":"numberOfPicks","type":"uint104"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"},{"internalType":"uint256","name":"prize","type":"uint256"}],"internalType":"struct IPrizeDistributionSource.PrizeDistribution","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x722e9BFC008358aC2d445a8d892cF7b62B550F3F","version":{"major":1,"minor":7,"patch":0},"type":"PrizeDistributor","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IDrawCalculator","name":"_drawCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"ClaimedDraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawCalculator","name":"calculator","type":"address"}],"name":"DrawCalculatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"TokenSet","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint32","name":"_drawId","type":"uint32"}],"name":"getDrawPayoutBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDrawCalculator","name":"_newCalculator","type":"address"}],"name":"setDrawCalculator","outputs":[{"internalType":"contract IDrawCalculator","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_erc20Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x4c65F496B78b7E81c15723f56a43925E5dc3a0e1","version":{"major":1,"minor":7,"patch":0},"type":"PrizeFlush","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":true,"internalType":"contract IReserve","name":"reserve","type":"address"},{"indexed":true,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"DestinationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Flushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IReserve","name":"reserve","type":"address"}],"name":"ReserveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"StrategySet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_destination","type":"address"}],"name":"setDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReserve","name":"_reserve","type":"address"}],"name":"setReserve","outputs":[{"internalType":"contract IReserve","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IStrategy","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[{"internalType":"contract IStrategy","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x8d7355075B85B2aDD775E02ec581E0Da66326E49","version":{"major":1,"minor":7,"patch":0},"type":"PrizeSplitStrategy","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IPrizePool","name":"_prizePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IPrizePool","name":"prizePool","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalPrizeCaptured","type":"uint256"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"prizeAwarded","type":"uint256"},{"indexed":true,"internalType":"contract IControlledToken","name":"token","type":"address"}],"name":"PrizeSplitAwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"target","type":"uint256"}],"name":"PrizeSplitRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint16","name":"percentage","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"PrizeSplitSet","type":"event"},{"inputs":[],"name":"ONE_AS_FIXED_POINT_3","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPrizePool","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_prizeSplitIndex","type":"uint256"}],"name":"getPrizeSplit","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeSplits","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig","name":"_prizeSplit","type":"tuple"},{"internalType":"uint8","name":"_prizeSplitIndex","type":"uint8"}],"name":"setPrizeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint16","name":"percentage","type":"uint16"}],"internalType":"struct IPrizeSplit.PrizeSplitConfig[]","name":"_newPrizeSplits","type":"tuple[]"}],"name":"setPrizeSplits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0xC88f04D5D00367Ecd016228302a1eACFaB164DBA","version":{"major":1,"minor":7,"patch":0},"type":"PrizeTierHistory","abi":[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"indexed":false,"internalType":"struct IPrizeTierHistory.PrizeTier","name":"prizeTier","type":"tuple"}],"name":"PrizeTierSet","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNewestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOldestDrawId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"drawId","type":"uint32"}],"name":"getPrizeTier","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPrizeTierAtIndex","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_drawIds","type":"uint32[]"}],"name":"getPrizeTierList","outputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"popAndPush","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"nextPrizeTier","type":"tuple"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"bitRangeSize","type":"uint8"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint32","name":"maxPicksPerUser","type":"uint32"},{"internalType":"uint32","name":"expiryDuration","type":"uint32"},{"internalType":"uint32","name":"endTimestampOffset","type":"uint32"},{"internalType":"uint256","name":"prize","type":"uint256"},{"internalType":"uint32[16]","name":"tiers","type":"uint32[16]"}],"internalType":"struct IPrizeTierHistory.PrizeTier","name":"newPrizeTier","type":"tuple"}],"name":"replace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0xdd96e37D6DD515A5E7325503fb3958192F98e49F","version":{"major":1,"minor":7,"patch":0},"type":"ReceiverTimelockTrigger","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IDrawBuffer","name":"_drawBuffer","type":"address"},{"internalType":"contract IPrizeDistributionFactory","name":"_prizeDistributionFactory","type":"address"},{"internalType":"contract IDrawCalculatorTimelock","name":"_timelock","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDrawBuffer","name":"drawBuffer","type":"address"},{"indexed":true,"internalType":"contract IPrizeDistributionFactory","name":"prizeDistributionFactory","type":"address"},{"indexed":true,"internalType":"contract IDrawCalculatorTimelock","name":"timelock","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"drawId","type":"uint32"},{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"indexed":false,"internalType":"struct IDrawBeacon.Draw","name":"draw","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"totalNetworkTicketSupply","type":"uint256"}],"name":"DrawLockedPushedAndTotalNetworkTicketSupplyPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"drawBuffer","outputs":[{"internalType":"contract IDrawBuffer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizeDistributionFactory","outputs":[{"internalType":"contract IPrizeDistributionFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"winningRandomNumber","type":"uint256"},{"internalType":"uint32","name":"drawId","type":"uint32"},{"internalType":"uint64","name":"timestamp","type":"uint64"},{"internalType":"uint64","name":"beaconPeriodStartedAt","type":"uint64"},{"internalType":"uint32","name":"beaconPeriodSeconds","type":"uint32"}],"internalType":"struct IDrawBeacon.Draw","name":"_draw","type":"tuple"},{"internalType":"uint256","name":"_totalNetworkTicketSupply","type":"uint256"}],"name":"push","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"contract IDrawCalculatorTimelock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x574834c934B3784aa8430A5B45724aAa2FcF2c7f","version":{"major":1,"minor":7,"patch":0},"type":"Reserve","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reserveAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAccumulated","type":"uint256"}],"name":"Checkpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"checkpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_startTimestamp","type":"uint32"},{"internalType":"uint32","name":"_endTimestamp","type":"uint32"}],"name":"getReserveAccumulatedBetween","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAccumulator","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x469C6F4c1AdA45EB2E251685aC2bf05aEd591E70","version":{"major":1,"minor":7,"patch":0},"type":"TWABDelegator","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegateeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint96","name":"lockUntil","type":"uint96"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"contract Delegation","name":"delegation","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"DelegationCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DelegationFundedFromStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":false,"internalType":"bool","name":"set","type":"bool"}],"name":"RepresentativeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TicketsUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferredDelegation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WithdrewDelegationToStake","type":"event"},{"inputs":[],"name":"MAX_LOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"computeDelegationAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"createDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationInstance","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegation","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fundDelegationFromStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"}],"name":"getDelegation","outputs":[{"internalType":"contract Delegation","name":"delegation","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"lockUntil","type":"uint256"},{"internalType":"bool","name":"wasCreated","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"address","name":"_representative","type":"address"}],"name":"isRepresentativeOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct PermitAndMulticall.Signature","name":"_permitSignature","type":"tuple"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"permitAndMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_representative","type":"address"},{"internalType":"bool","name":"_set","type":"bool"}],"name":"setRepresentative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferDelegationTo","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"uint96","name":"_lockDuration","type":"uint96"}],"name":"updateDelegatee","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegator","type":"address"},{"internalType":"uint256","name":"_slot","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawDelegationToStake","outputs":[{"internalType":"contract Delegation","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x62BB4fc73094c83B5e952C2180B23fA7054954c4","version":{"major":1,"minor":7,"patch":0},"type":"Ticket","abi":[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegate","type":"address"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTotalSupplyTwab","type":"tuple"}],"name":"NewTotalSupplyTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"indexed":false,"internalType":"struct ObservationLib.Observation","name":"newTwab","type":"tuple"}],"name":"NewUserTwab","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":true,"internalType":"address","name":"controller","type":"address"}],"name":"TicketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerBurnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"controllerDelegateFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"controllerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"delegateOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_newDelegate","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"delegateWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAccountDetails","outputs":[{"components":[{"internalType":"uint208","name":"balance","type":"uint208"},{"internalType":"uint24","name":"nextTwabIndex","type":"uint24"},{"internalType":"uint24","name":"cardinality","type":"uint24"}],"internalType":"struct TwabLib.AccountDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_startTime","type":"uint64"},{"internalType":"uint64","name":"_endTime","type":"uint64"}],"name":"getAverageBalanceBetween","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageBalancesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_startTimes","type":"uint64[]"},{"internalType":"uint64[]","name":"_endTimes","type":"uint64[]"}],"name":"getAverageTotalSuppliesBetween","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getBalanceAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getBalancesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"_targets","type":"uint64[]"}],"name":"getTotalSuppliesAt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_target","type":"uint64"}],"name":"getTotalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"getTwab","outputs":[{"components":[{"internalType":"uint224","name":"amount","type":"uint224"},{"internalType":"uint32","name":"timestamp","type":"uint32"}],"internalType":"struct ObservationLib.Observation","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x1470c87e2db5247A36C60DE3D65D7C972C62EA0f","version":{"major":1,"minor":7,"patch":0},"type":"TwabRewards","abi":[{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"}],"name":"PromotionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PromotionDestroyed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"epochNumber","type":"uint8"}],"name":"PromotionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"PromotionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"promotionId","type":"uint256"},{"indexed":false,"internalType":"uint8[]","name":"epochIds","type":"uint8[]"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"inputs":[],"name":"GRACE_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint64","name":"_startTimestamp","type":"uint64"},{"internalType":"uint256","name":"_tokensPerEpoch","type":"uint256"},{"internalType":"uint48","name":"_epochDuration","type":"uint48"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"createPromotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"destroyPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"endPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8","name":"_numberOfEpochs","type":"uint8"}],"name":"extendPromotion","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getCurrentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getPromotion","outputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint8","name":"numberOfEpochs","type":"uint8"},{"internalType":"uint48","name":"epochDuration","type":"uint48"},{"internalType":"uint48","name":"createdAt","type":"uint48"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"tokensPerEpoch","type":"uint256"},{"internalType":"uint256","name":"rewardsUnclaimed","type":"uint256"}],"internalType":"struct ITwabRewards.Promotion","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promotionId","type":"uint256"}],"name":"getRemainingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_promotionId","type":"uint256"},{"internalType":"uint8[]","name":"_epochIds","type":"uint8[]"}],"name":"getRewardsAmount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}},{"chainId":10,"address":"0x79Bc8bD53244bC8a9C8c27509a2d573650A83373","version":{"major":1,"minor":7,"patch":0},"type":"YieldSourcePrizePool","abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"contract IYieldSource","name":"_yieldSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Awarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AwardedExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AwardedExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"balanceCap","type":"uint256"}],"name":"BalanceCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"}],"name":"ControlledTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"yieldSource","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"error","type":"bytes"}],"name":"ErrorAwardingExternalERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"liquidityCap","type":"uint256"}],"name":"LiquidityCapSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipOffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prizeStrategy","type":"address"}],"name":"PrizeStrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swept","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ITicket","name":"ticket","type":"address"}],"name":"TicketSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferredExternalERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"contract ITicket","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemed","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"award","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"awardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"awardExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"awardExternalERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_externalToken","type":"address"}],"name":"canAwardExternal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"captureAwardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICompLike","name":"_compLike","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"compLikeDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_delegate","type":"address"}],"name":"depositToAndDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccountedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLiquidityCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeStrategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTicket","outputs":[{"internalType":"contract ITicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_controlledToken","type":"address"}],"name":"isControlled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_balanceCap","type":"uint256"}],"name":"setBalanceCap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidityCap","type":"uint256"}],"name":"setLiquidityCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prizeStrategy","type":"address"}],"name":"setPrizeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITicket","name":"_ticket","type":"address"}],"name":"setTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address","name":"_externalToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferExternalERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldSource","outputs":[{"internalType":"contract IYieldSource","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"tags":[],"extensions":{}}]} \ No newline at end of file diff --git a/package.json b/package.json index cf6e4bf..9e20d51 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pooltogether/v4-mainnet", - "version": "1.6.1", + "version": "1.7.0", "main": "index.js", "repository": "git@github.com:pooltogether/v4-mainnet.git", "author": "PoolTogether Inc.", @@ -37,6 +37,7 @@ "deploy:v1.5.0.mainnet": "DEPLOY=v1.5.0.mainnet hardhat deploy --network mainnet", "deploy:v1.6.0.optimism": "DEPLOY=v1.6.0.optimism hardhat deploy --network optimism", "deploy:v1.6.1.optimism": "DEPLOY=v1.6.1.optimism hardhat deploy --network optimism", + "deploy:v1.7.0.polygon": "DEPLOY=v1.7.0.polygon hardhat deploy --network polygon", "simulate:mainnet": "hardhat --config hardhat.config.ts run ./scripts/fork/beacon.mainnet.forkRunUpgradeV110.ts --network localhost", "simulate:polygon": "hardhat --config hardhat.config.ts run ./scripts/fork/receiver.polygon.forkRunUpgradeV110.ts --network localhost", "node:ethereum": "DEPLOY=mainnet hardhat node --network hardhat", @@ -94,7 +95,7 @@ "@ethersproject/hardware-wallets": "5.6.0", "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers", "@nomiclabs/hardhat-etherscan": "3.0.0", - "@pooltogether/hardhat-deploy-markdown-export": "0.3.2", + "@pooltogether/hardhat-deploy-markdown-export": "0.3.5", "@types/jsonfile": "6.0.1", "@types/node": "17.0.12", "ajv": "8.9.0", diff --git a/yarn.lock b/yarn.lock index d1b8e5d..8bf407b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -973,10 +973,10 @@ resolved "https://registry.yarnpkg.com/@pooltogether/fixed-point/-/fixed-point-1.0.0.tgz#2c9fb9fe1cca557ca2be7b9ed7414d5edd5a816f" integrity sha512-YhvjswZuDpKK/NFboyeFWoXhq4763kbi/hNx0L5+6kCRUq8WruvXR4WFvWlDo+5Dx1UsaOnPygAMfrJT0h7bMw== -"@pooltogether/hardhat-deploy-markdown-export@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@pooltogether/hardhat-deploy-markdown-export/-/hardhat-deploy-markdown-export-0.3.2.tgz#ee25e1c14f11d8eb85cd4d2752d425f2f827476c" - integrity sha512-DnNEmWG0AwWRiQbQinWerNnUzOT+wNuw6gxe8OEXfwDsOtCukNubMldJaP550+hgwLl8pOQdJp0v66WajR0WFQ== +"@pooltogether/hardhat-deploy-markdown-export@0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@pooltogether/hardhat-deploy-markdown-export/-/hardhat-deploy-markdown-export-0.3.5.tgz#52b8d97f54f7128ac40795ab1ab1a8cbb1ad89f4" + integrity sha512-ho29xvI5hmnVlCPmug8Qjbw0XQl43Jld3LfanQ8bEsxkAx85sXyZFHgwUvjMpXTsjOeFr058gIKfmx/QIcUHew== "@pooltogether/owner-manager-contracts@1.1.0": version "1.1.0"