{"file_path":"./contracts/inflation/implementation/Supply.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\nimport \"../interface/IISupply.sol\";\nimport \"../../tokenPools/interface/IITokenPool.sol\";\nimport \"../../token/lib/CheckPointHistory.sol\";\nimport \"../../token/lib/CheckPointHistoryCache.sol\";\nimport \"../../governance/implementation/Governed.sol\";\nimport \"../../addressUpdater/implementation/AddressUpdatable.sol\";\nimport \"../../utils/implementation/AddressSet.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n\n/**\n * @title Supply contract\n * @notice This contract maintains and computes various native token supply totals.\n **/\n\ncontract Supply is IISupply, Governed, AddressUpdatable {\n    using CheckPointHistory for CheckPointHistory.CheckPointHistoryState;\n    using CheckPointHistoryCache for CheckPointHistoryCache.CacheState;\n    using SafeMath for uint256;\n    using AddressSet for AddressSet.State;\n\n    struct SupplyData {\n        IITokenPool tokenPool;\n        uint256 totalLockedWei;\n        uint256 totalInflationAuthorizedWei;\n        uint256 totalClaimedWei;\n    }\n\n    address payable private constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;\n    address payable private constant BURN_ADDRESS_SONGBIRD_TX_FEE = 0x0100000000000000000000000000000000000000;\n\n    uint256 constant internal SWITCH_OVER_BLOCK = uint(-1);\n\n    string internal constant ERR_INFLATION_ONLY = \"inflation only\";\n    string internal constant ERR_TOKEN_POOL_ALREADY_ADDED = \"token pool already added\";\n    string internal constant ERR_INITIAL_GENESIS_AMOUNT_ZERO = \"initial genesis amount zero\";\n\n    CheckPointHistory.CheckPointHistoryState private circulatingSupplyWei;\n    CheckPointHistoryCache.CacheState private circulatingSupplyWeiCache;\n\n    uint256 immutable public initialGenesisAmountWei;\n    uint256 immutable public totalExcludedSupplyWei; // Distribution treasury, team escrow\n    uint256 public distributedExcludedSupplyWei;\n    uint256 public totalLockedWei; // Amounts temporary locked and not considered in the inflatable supply\n    uint256 public totalInflationAuthorizedWei;\n    uint256 public totalClaimedWei;\n\n    SupplyData[] public tokenPools;\n\n    address public inflation;\n\n    IISupply public oldSupply;\n    uint256 public switchOverBlock;\n\n    // balance of burn addresses at last check - needed for updating circulating supply\n    uint256 private burnAddressesBalance;\n\n    AddressSet.State private foundationAddresses;\n    // balance of all Foundation address at last check - needed for updating circulating supply\n    uint256 private foundationAddressesBalance;\n\n    // events\n    event AuthorizedInflationUpdateError(uint256 actual, uint256 expected);\n    event FoundationAddressesChanged(address[] addedFoundationAddresses, address[] removedFoundationAddresses);\n\n    modifier onlyInflation {\n        require(msg.sender == inflation, ERR_INFLATION_ONLY);\n        _;\n    }\n\n    constructor(\n        address _governance,\n        address _addressUpdater,\n        uint256 _initialGenesisAmountWei,\n        uint256 _totalExcludedSupplyWei,\n        IITokenPool[] memory _tokenPools,\n        address[] memory _foundationAddresses,\n        IISupply _oldSupply\n    )\n        Governed(_governance) AddressUpdatable(_addressUpdater)\n    {\n        require(_initialGenesisAmountWei > 0, ERR_INITIAL_GENESIS_AMOUNT_ZERO);\n        initialGenesisAmountWei = _initialGenesisAmountWei;\n        totalExcludedSupplyWei = _totalExcludedSupplyWei;\n\n        _increaseCirculatingSupply(_initialGenesisAmountWei.sub(_totalExcludedSupplyWei));\n\n        for (uint256 i = 0; i < _tokenPools.length; i++) {\n            _addTokenPool(_tokenPools[i]);\n        }\n\n        foundationAddresses.addAll(_foundationAddresses);\n        emit FoundationAddressesChanged(_foundationAddresses, new address[](0));\n\n        if (_oldSupply != IISupply(0)) {\n            oldSupply = _oldSupply;\n            switchOverBlock = SWITCH_OVER_BLOCK;\n        }\n\n        _updateCirculatingSupply();\n    }\n\n    /**\n     * @notice Updates circulating supply\n     * @dev Also updates the burn address amount\n    */\n    function updateCirculatingSupply() external override onlyInflation {\n        if (switchOverBlock == SWITCH_OVER_BLOCK) {\n            switchOverBlock = block.number;\n        }\n        _updateCirculatingSupply();\n    }\n\n    /**\n     * @notice Updates authorized inflation and circulating supply - emits event if error\n     * @param _inflationAuthorizedWei               Authorized inflation\n     * @dev Also updates the burn address amount\n    */\n    function updateAuthorizedInflationAndCirculatingSupply(\n            uint256 _inflationAuthorizedWei\n    )\n        external override\n        onlyInflation\n    {\n        // Save old total inflation authorized value to compare with after update.\n        uint256 oldTotalInflationAuthorizedWei = totalInflationAuthorizedWei;\n\n        _updateCirculatingSupply();\n\n        // Check if new authorized inflation was distributed and updated correctly.\n        if (totalInflationAuthorizedWei != oldTotalInflationAuthorizedWei.add(_inflationAuthorizedWei)) {\n            emit AuthorizedInflationUpdateError(totalInflationAuthorizedWei - oldTotalInflationAuthorizedWei,\n                _inflationAuthorizedWei);\n        }\n    }\n\n    /**\n     * @notice Adds token pool so it can call updateTokenPoolDistributedAmount method when\n        some tokens are distributed\n     * @param _tokenPool                            Token pool address\n     * @param _increaseDistributedSupplyByAmountWei If token pool was given initial supply from excluded supply,\n        increase distributed value by this amount\n     */\n    function addTokenPool(\n        IITokenPool _tokenPool,\n        uint256 _increaseDistributedSupplyByAmountWei\n    )\n        external\n        onlyGovernance\n    {\n        _increaseDistributedSupply(_increaseDistributedSupplyByAmountWei);\n        _addTokenPool(_tokenPool);\n        _updateCirculatingSupply();\n    }\n\n    /**\n     * @notice Change foundation addresses\n     * @param _foundationAddressesToAdd             Foundation addresses to add\n     * @param _foundationAddressesToRemove          Foundation addresses to remove\n     */\n    function changeFoundationAddresses(\n        address[] memory _foundationAddressesToAdd,\n        address[] memory _foundationAddressesToRemove\n    )\n        external\n        onlyGovernance\n    {\n        emit FoundationAddressesChanged(_foundationAddressesToAdd, _foundationAddressesToRemove);\n        for (uint256 i = 0; i < _foundationAddressesToRemove.length; i++) {\n            foundationAddresses.remove(_foundationAddressesToRemove[i]);\n        }\n        foundationAddresses.addAll(_foundationAddressesToAdd);\n        _updateCirculatingSupply();\n    }\n\n    /**\n     * @notice Increase distributed supply when excluded funds are released to a token pool or team members\n     * @param _amountWei                            Amount to increase by\n     */\n    function increaseDistributedSupply(uint256 _amountWei) external onlyGovernance {\n        _increaseDistributedSupply(_amountWei);\n        _updateCirculatingSupply();\n    }\n\n    /**\n     * @notice Decrease distributed supply if excluded funds are no longer locked to a token pool\n     * @param _amountWei                            Amount to decrease by\n     */\n    function decreaseDistributedSupply(uint256 _amountWei) external onlyGovernance {\n        distributedExcludedSupplyWei = distributedExcludedSupplyWei.sub(_amountWei);\n        _decreaseCirculatingSupply(_amountWei);\n        _updateCirculatingSupply();\n    }\n\n    /**\n     * @notice Get approximate circulating supply for given block number from cache - only past block\n     * @param _blockNumber                          Block number\n     * @return _circulatingSupplyWei Return approximate circulating supply for last known block <= _blockNumber\n    */\n    function getCirculatingSupplyAtCached(\n        uint256 _blockNumber\n    )\n        external override\n        returns(uint256 _circulatingSupplyWei)\n    {\n        // use cache only for the past (the value will never change)\n        require(_blockNumber < block.number, \"Can only be used for past blocks\");\n        if (_blockNumber < switchOverBlock) {\n            return oldSupply.getCirculatingSupplyAtCached(_blockNumber);\n        }\n        (_circulatingSupplyWei,) = circulatingSupplyWeiCache.valueAt(circulatingSupplyWei, _blockNumber);\n    }\n\n    /**\n     * @notice Get approximate circulating supply for given block number\n     * @param _blockNumber                          Block number\n     * @return _circulatingSupplyWei Return approximate circulating supply for last known block <= _blockNumber\n    */\n    function getCirculatingSupplyAt(\n        uint256 _blockNumber\n    )\n        external view override\n        returns(uint256 _circulatingSupplyWei)\n    {\n        if (_blockNumber < switchOverBlock) {\n            return oldSupply.getCirculatingSupplyAt(_blockNumber);\n        }\n        return circulatingSupplyWei.valueAt(_blockNumber);\n    }\n\n    /**\n     * @notice Get total inflatable balance (initial genesis amount + total claimed - total excluded/locked amount)\n     * @return _inflatableBalanceWei Return inflatable balance\n    */\n    function getInflatableBalance() external view override returns(uint256 _inflatableBalanceWei) {\n        if (block.number < switchOverBlock) {\n            return oldSupply.getInflatableBalance();\n        }\n        return initialGenesisAmountWei\n            .add(totalClaimedWei)\n            .sub(totalExcludedSupplyWei.sub(distributedExcludedSupplyWei))\n            .sub(totalLockedWei);\n    }\n\n    /**\n     * @notice Return the list of Foundation addresses.\n     */\n    function getFoundationAddresses() external view returns(address[] memory) {\n        return foundationAddresses.list;\n    }\n\n    /**\n     * @notice Return the burn address (a constant).\n     */\n    function burnAddress() external pure returns(address payable) {\n        return BURN_ADDRESS;\n    }\n\n    /**\n     * @notice Return the burn address used on Songbird for tx fee (a constant).\n     */\n    function burnAddressSongbirdTxFee() external pure returns(address payable) {\n        return BURN_ADDRESS_SONGBIRD_TX_FEE;\n    }\n\n    /**\n     * @notice Implementation of the AddressUpdatable abstract method.\n     */\n    function _updateContractAddresses(\n        bytes32[] memory _contractNameHashes,\n        address[] memory _contractAddresses\n    )\n        internal override\n    {\n        inflation = _getContractAddress(_contractNameHashes, _contractAddresses, \"Inflation\");\n    }\n\n    function _increaseCirculatingSupply(uint256 _increaseBy) internal {\n        circulatingSupplyWei.writeValue(circulatingSupplyWei.valueAtNow().add(_increaseBy));\n    }\n\n    function _decreaseCirculatingSupply(uint256 _decreaseBy) internal {\n        circulatingSupplyWei.writeValue(circulatingSupplyWei.valueAtNow().sub(_decreaseBy));\n    }\n\n    function _updateCirculatingSupply() internal {\n        uint256 len = tokenPools.length;\n        for (uint256 i = 0; i < len; i++) {\n            SupplyData storage data = tokenPools[i];\n\n            uint256 newTotalLockedWei;\n            uint256 newTotalInflationAuthorizedWei;\n            uint256 newTotalClaimedWei;\n\n            (newTotalLockedWei, newTotalInflationAuthorizedWei, newTotalClaimedWei) =\n                data.tokenPool.getTokenPoolSupplyData();\n            assert(newTotalLockedWei.add(newTotalInflationAuthorizedWei) >= newTotalClaimedWei);\n\n            // updates total inflation authorized with daily authorized inflation\n            uint256 dailyInflationAuthorizedWei = newTotalInflationAuthorizedWei.sub(data.totalInflationAuthorizedWei);\n            totalInflationAuthorizedWei = totalInflationAuthorizedWei.add(dailyInflationAuthorizedWei);\n\n            // updates circulating supply\n            uint256 claimChange = newTotalClaimedWei.sub(data.totalClaimedWei);\n            _increaseCirculatingSupply(claimChange);\n            totalClaimedWei = totalClaimedWei.add(claimChange);\n            if (newTotalLockedWei >= data.totalLockedWei) {\n                uint256 lockChange = newTotalLockedWei - data.totalLockedWei;\n                _decreaseCirculatingSupply(lockChange);\n                totalLockedWei = totalLockedWei.add(lockChange);\n            } else {\n                // if founds are unlocked, they are returned to excluded amount\n                uint256 lockChange = data.totalLockedWei - newTotalLockedWei;\n                distributedExcludedSupplyWei = distributedExcludedSupplyWei.sub(lockChange);\n                totalLockedWei = totalLockedWei.sub(lockChange);\n            }\n\n            // update data\n            data.totalLockedWei = newTotalLockedWei;\n            data.totalInflationAuthorizedWei = newTotalInflationAuthorizedWei;\n            data.totalClaimedWei = newTotalClaimedWei;\n        }\n\n        _updateBurnAddressesAmount();\n        _updateFoundationAddressesAmount();\n    }\n\n    function _updateBurnAddressesAmount() internal {\n        uint256 newBalance = BURN_ADDRESS.balance.add(BURN_ADDRESS_SONGBIRD_TX_FEE.balance);\n        _decreaseCirculatingSupply(newBalance.sub(burnAddressesBalance));\n        burnAddressesBalance = newBalance;\n    }\n\n    function _updateFoundationAddressesAmount() internal {\n        uint256 newBalance = 0;\n        address[] memory addresses = foundationAddresses.list;\n        for (uint256 i = 0; i < addresses.length; i++) {\n            newBalance = newBalance.add(addresses[i].balance);\n        }\n        if (foundationAddressesBalance == newBalance) {\n            return;\n        } else if (foundationAddressesBalance > newBalance) {\n            _increaseCirculatingSupply(foundationAddressesBalance - newBalance);\n        } else {\n            _decreaseCirculatingSupply(newBalance - foundationAddressesBalance);\n        }\n        foundationAddressesBalance = newBalance;\n    }\n\n    function _addTokenPool(IITokenPool _tokenPool) internal {\n        uint256 len = tokenPools.length;\n        for (uint256 i = 0; i < len; i++) {\n            if (_tokenPool == tokenPools[i].tokenPool) {\n                revert(ERR_TOKEN_POOL_ALREADY_ADDED);\n            }\n        }\n        tokenPools.push();\n        tokenPools[len].tokenPool = _tokenPool;\n    }\n\n    function _increaseDistributedSupply(uint256 _amountWei) internal {\n        assert(totalExcludedSupplyWei.sub(distributedExcludedSupplyWei) >= _amountWei);\n        _increaseCirculatingSupply(_amountWei);\n        distributedExcludedSupplyWei = distributedExcludedSupplyWei.add(_amountWei);\n    }\n}\n","deployed_bytecode":"0x608060405234801561001057600080fd5b50600436106101ef5760003560e01c80639f71043e1161010f578063d9330e63116100a2578063e433f81811610071578063e433f818146106f6578063efac34cc146106fe578063efcf7eb214610756578063f5a9838314610782576101ef565b8063d9330e6314610698578063dc2603bb146106b5578063df3d9b73146106bd578063e17f212e146106da576101ef565b8063be0522e0116100de578063be0522e014610678578063bfebbd2614610680578063c6faaafa14610688578063d0c1c39314610690576101ef565b80639f71043e1461040d578063a2420e2014610415578063b00c0b7614610432578063b646900414610555576101ef565b80635aa6e6751161018757806367fc40291161015657806367fc40291461031257806370d5ae051461033957806374e6310e146103415780639d6a890f146103e7576101ef565b80635aa6e675146102be5780635ff27079146102c65780636159b0a3146102ed57806362354e031461030a576101ef565b80631b73b4cb116101c35780631b73b4cb1461029c57806332ae2927146102a45780633c8c461c146102ac5780635267a15d146102b6576101ef565b8062c0f916146101f4578063037b0890146102415780630585084414610270578063099eea6214610294575b600080fd5b6102116004803603602081101561020a57600080fd5b503561078a565b604080516001600160a01b0390951685526020850193909352838301919091526060830152519081900360800190f35b61025e6004803603602081101561025757600080fd5b50356107ce565b60408051918252519081900360200190f35b6102786108c4565b604080516001600160a01b039092168252519081900360200190f35b61025e6108d3565b61025e6108d9565b61025e6109de565b6102b46109e4565b005b610278610abc565b610278610ae1565b6102b4600480360360208110156102dc57600080fd5b50356001600160e01b031916610b75565b6102b46004803603602081101561030357600080fd5b5035610eca565b610278610f2d565b6102b46004803603602081101561032857600080fd5b50356001600160e01b031916610f38565b610278611020565b6103686004803603602081101561035757600080fd5b50356001600160e01b031916611026565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156103ab578181015183820152602001610393565b50505050905090810190601f1680156103d85780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b6102b4600480360360208110156103fd57600080fd5b50356001600160a01b03166110cc565b61025e611185565b6102b46004803603602081101561042b57600080fd5b503561118b565b6102b46004803603604081101561044857600080fd5b810190602081018135600160201b81111561046257600080fd5b82018360208201111561047457600080fd5b803590602001918460208302840111600160201b8311171561049557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156104e457600080fd5b8201836020820111156104f657600080fd5b803590602001918460208302840111600160201b8311171561051757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061126d945050505050565b6102b46004803603604081101561056b57600080fd5b810190602081018135600160201b81111561058557600080fd5b82018360208201111561059757600080fd5b803590602001918460208302840111600160201b831117156105b857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561060757600080fd5b82018360208201111561061957600080fd5b803590602001918460208302840111600160201b8311171561063a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611314945050505050565b61027861145d565b61025e61146c565b610278611490565b61025e611498565b61025e600480360360208110156106ae57600080fd5b503561149e565b61025e61151b565b6102b4600480360360208110156106d357600080fd5b5035611521565b6106e2611559565b604080519115158252519081900360200190f35b61025e611569565b61070661158d565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561074257818101518382015260200161072a565b505050509050019250505060405180910390f35b6102b46004803603604081101561076c57600080fd5b506001600160a01b0381351690602001356115f2565b6102b4611633565b6009818154811061079a57600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169350919084565b6000438210610824576040805162461bcd60e51b815260206004820181905260248201527f43616e206f6e6c79206265207573656420666f72207061737420626c6f636b73604482015290519081900360640190fd5b600c548210156108ae57600b54604080516237b08960e41b81526004810185905290516001600160a01b039092169163037b0890916024808201926020929091908290030181600087803b15801561087b57600080fd5b505af115801561088f573d6000803e3d6000fd5b505050506040513d60208110156108a557600080fd5b505190506108bf565b6108bb6004600284611a33565b5090505b919050565b600b546001600160a01b031681565b60055481565b6000600c5443101561096657600b60009054906101000a90046001600160a01b03166001600160a01b0316631b73b4cb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561093357600080fd5b505afa158015610947573d6000803e3d6000fd5b505050506040513d602081101561095d57600080fd5b505190506109db565b6109d86006546109d26109a46005547f0000000000000000000000000000000000000000dbb8481a7362102da00000006116ed90919063ffffffff16565b6008546109d2907f0000000000000000000000000000000000000001431e0fae6d7217caa0000000906117c4565b906116ed565b90505b90565b60065481565b600a5460408051808201909152600e81526d696e666c6174696f6e206f6e6c7960901b6020820152906001600160a01b03163314610aa05760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a65578181015183820152602001610a4d565b50505050905090810190601f168015610a925780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600019600c541415610ab25743600c555b610aba611a91565b565b7f714f205b2abd25bef1d06a1af944e38c113fe6160375c4e1d6d5cf28848e77195490565b60008054600160a81b900460ff16610b04576000546001600160a01b03166109d8565b60076001609c1b016001600160a01b031663732524946040518163ffffffff1660e01b815260040160206040518083038186803b158015610b4457600080fd5b505afa158015610b58573d6000803e3d6000fd5b505050506040513d6020811015610b6e57600080fd5b5051905090565b60408051630debfda360e41b8152336004820152905160076001609c1b019163debfda30916024808301926020929190829003018186803b158015610bb957600080fd5b505afa158015610bcd573d6000803e3d6000fd5b505050506040513d6020811015610be357600080fd5b5051610c26576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9032bc32b1baba37b960991b604482015290519081900360640190fd5b6001600160e01b0319811660009081526001602052604090208054610c92576040805162461bcd60e51b815260206004820152601a60248201527f74696d656c6f636b3a20696e76616c69642073656c6563746f72000000000000604482015290519081900360640190fd5b8054421015610ce8576040805162461bcd60e51b815260206004820152601960248201527f74696d656c6f636b3a206e6f7420616c6c6f7765642079657400000000000000604482015290519081900360640190fd5b6000816001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050506001600160e01b0319861660009081526001602081905260408220828155949550909250610db691508301826126c2565b50506000805460ff60b01b1916600160b01b178155604051825130918491819060208401908083835b60208310610dfe5780518252601f199092019160209182019101610ddf565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610e60576040519150601f19603f3d011682016040523d82523d6000602084013e610e65565b606091505b50506000805460ff60b01b19169055604080516001600160e01b03198716815242602082015281519293507fa7326b57fc9cfe267aaea5e7f0b01757154d265620a0585819416ee9ddd2c438929081900390910190a1610ec481611c42565b50505050565b600054600160b01b900460ff1680610eec5750600054600160a81b900460ff16155b15610f1f57610ef9611c5f565b600554610f0690826116ed565b600555610f1281611c94565b610f1a611a91565b610f2a565b610f2a600036611cad565b50565b60076001609c1b0181565b610f40611e30565b6001600160e01b03198116600090815260016020526040902054610fab576040805162461bcd60e51b815260206004820152601a60248201527f74696d656c6f636b3a20696e76616c69642073656c6563746f72000000000000604482015290519081900360640190fd5b604080516001600160e01b03198316815242602082015281517f7735b2391c38a81419c513e30ca578db7158eadd7101511b23e221c654d19cf8929181900390910190a16001600160e01b0319811660009081526001602081905260408220828155919061101b908301826126c2565b505050565b61dead90565b600160208181526000928352604092839020805481840180548651600296821615610100026000190190911695909504601f810185900485028601850190965285855290949193929091908301828280156110c25780601f10611097576101008083540402835291602001916110c2565b820191906000526020600020905b8154815290600101906020018083116110a557829003601f168201915b5050505050905082565b600054600160a01b900460ff1615611122576040805162461bcd60e51b8152602060048201526014602482015273696e697469616c6973656420213d2066616c736560601b604482015290519081900360640190fd5b60008054600160a01b60ff60a01b19909116176001600160a01b0319166001600160a01b03831690811790915560408051918252517f9789733827840833afc031fb2ef9ab6894271f77bad2085687cf4ae5c7bee4db916020908290030190a150565b60085481565b600a5460408051808201909152600e81526d696e666c6174696f6e206f6e6c7960901b6020820152906001600160a01b0316331461120a5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610a65578181015183820152602001610a4d565b50600754611216611a91565b61122081836117c4565b6007541461126957600754604080519183900382526020820184905280517feeb8970a03ae6e5930263b6b2553da66b8e20080d79a3f33c139e5855574eb739281900390910190a15b5050565b611275610abc565b6001600160a01b0316336001600160a01b0316146112d1576040805162461bcd60e51b815260206004820152601460248201527337b7363c9030b2323932b9b9903ab83230ba32b960611b604482015290519081900360640190fd5b61130a61130583836040518060400160405280600e81526020016d20b2323932b9b9aab83230ba32b960911b815250611e8f565b611fbc565b6112698282611fe0565b600054600160b01b900460ff16806113365750600054600160a81b900460ff16155b1561145257611343611c5f565b7f5c3fa658268afebe402cb474fc8481cb13cb4f9230b78161b64024af71ed94988282604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156113aa578181015183820152602001611392565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156113e95781810151838201526020016113d1565b5050505090500194505050505060405180910390a160005b81518110156114395761143182828151811061141957fe5b6020026020010151600e61203090919063ffffffff16565b600101611401565b50611445600e8361174a565b61144d611a91565b611269565b611269600036611cad565b600a546001600160a01b031681565b7f0000000000000000000000000000000000000001431e0fae6d7217caa000000081565b600160981b90565b60075481565b6000600c5482101561150a57600b546040805163d9330e6360e01b81526004810185905290516001600160a01b039092169163d9330e6391602480820192602092909190829003018186803b1580156114f657600080fd5b505afa15801561088f573d6000803e3d6000fd5b61151560028361212b565b92915050565b600c5481565b600054600160b01b900460ff16806115435750600054600160a81b900460ff16155b15610f1f57611550611c5f565b610f1281612272565b600054600160a81b900460ff1681565b7f0000000000000000000000000000000000000000dbb8481a7362102da000000081565b6060600e6000018054806020026020016040519081016040528092919081815260200182805480156115e857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116115ca575b5050505050905090565b600054600160b01b900460ff16806116145750600054600160a81b900460ff16155b1561145257611621611c5f565b61162a81612272565b611445826122cc565b61163b611e30565b600054600160a81b900460ff161561169a576040805162461bcd60e51b815260206004820152601a60248201527f616c726561647920696e2070726f64756374696f6e206d6f6465000000000000604482015290519081900360640190fd5b60008054600161ff0160a01b031916600160a81b1790556040805160076001609c1b01815290517f83af113638b5422f9e977cebc0aaf0eaf2188eb9a8baae7f9d46c42b33a1560c9181900360200190a1565b600082821115611744576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60005b815181101561101b576117738383838151811061176657fe5b60200260200101516123da565b60010161174d565b6001810154600090600160401b900467ffffffffffffffff16806117a35760009150506108bf565b6000190160009081526020929092525060409020546001600160c01b031690565b60008282018381101561181e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001820154600160401b900467ffffffffffffffff16806118de57604051806040016040528061185484612443565b6001600160c01b0316815260200161186b436119eb565b67ffffffffffffffff908116909152600080805260208681526040909120835181549490920151909216600160c01b026001600160c01b039182166001600160c01b0319909416939093171691909117905560018301805467ffffffffffffffff60401b1916600160401b17905561101b565b600019810160009081526020849052604090208054600160c01b900467ffffffffffffffff16438114156119355761191584612443565b82546001600160c01b0319166001600160c01b03919091161782556119e4565b80431161193e57fe5b604051806040016040528061195286612443565b6001600160c01b03168152602001611969436119eb565b67ffffffffffffffff9081169091526000858152602088815260409091208351815494909201518316600160c01b026001600160c01b039283166001600160c01b0319909516949094179091169290921790915560018087018054918601909216600160401b0267ffffffffffffffff60401b199091161790555b5050505050565b6000600160401b8210611a2f5760405162461bcd60e51b81526004018080602001828103825260268152602001806127a06026913960400191505060405180910390fd5b5090565b60008181526020849052604081205481908015611a595760001901915060009050611a89565b6000611a65868661212b565b9050611a728160016117c4565b600086815260208990526040902055925060019150505b935093915050565b60095460005b81811015611c3157600060098281548110611aae57fe5b600091825260208220600491820201805460408051632dafdbbf60e01b81529051929550849384936001600160a01b0390931692632dafdbbf92808301926060929182900301818787803b158015611b0557600080fd5b505af1158015611b19573d6000803e3d6000fd5b505050506040513d6060811015611b2f57600080fd5b5080516020820151604090920151909450909250905080611b5084846117c4565b1015611b5857fe5b6000611b718560020154846116ed90919063ffffffff16565b600754909150611b8190826117c4565b6007556003850154600090611b979084906116ed565b9050611ba28161249d565b600854611baf90826117c4565b60085560018601548510611be35760018601548503611bcd81611c94565b600654611bda90826117c4565b60065550611c0f565b60018601546005549086900390611bfa90826116ed565b600555600654611c0a90826116ed565b600655505b5050600180850193909355600284019190915560039092019190915501611a97565b50611c3a6124b4565b610f2a6124ec565b3d604051818101604052816000823e8215611c5b578181f35b8181fd5b600054600160b01b900460ff1615611c8c57333014611c7a57fe5b6000805460ff60b01b19169055610aba565b610aba611e30565b610f2a611ca5826109d2600261177b565b600290611825565b611cb5611e30565b600082359050600060076001609c1b016001600160a01b0316636221a54b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611cfd57600080fd5b505afa158015611d11573d6000803e3d6000fd5b505050506040513d6020811015611d2757600080fd5b505160408051808201825242830180825282516020601f89018190048102820181019094528781529394509290918281019190889088908190840183828082843760009201829052509390945250506001600160e01b03198616815260016020818152604090922084518155848301518051919450611dab93928501920190612706565b509050507fed948300a3694aa01d4a6b258bfd664350193d770c0b51f8387277f6d83ea3b68382878760405180856001600160e01b0319168152602001848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f191690920182900397509095505050505050a15050505050565b611e38610ae1565b6001600160a01b0316336001600160a01b031614610aba576040805162461bcd60e51b815260206004820152600f60248201526e6f6e6c7920676f7665726e616e636560881b604482015290519081900360640190fd5b600080826040516020018080602001828103825283818151815260200191508051906020019080838360005b83811015611ed3578181015183820152602001611ebb565b50505050905090810190601f168015611f005780820380516001836020036101000a031916815260200191505b50925050506040516020818303038152906040528051906020012090506000805b8651811015611f6857868181518110611f3657fe5b6020026020010151831415611f6057858181518110611f5157fe5b60200260200101519150611f68565b600101611f21565b506001600160a01b038116611fb3576040805162461bcd60e51b815260206004820152600c60248201526b61646472657373207a65726f60a01b604482015290519081900360640190fd5b95945050505050565b7f714f205b2abd25bef1d06a1af944e38c113fe6160375c4e1d6d5cf28848e771955565b61200c82826040518060400160405280600981526020016824b7333630ba34b7b760b91b815250611e8f565b600a80546001600160a01b0319166001600160a01b03929092169190911790555050565b6001600160a01b0381166000908152600183016020526040902054806120565750611269565b82548110156120de5782546000908490600019810190811061207457fe5b60009182526020909120015484546001600160a01b0390911691508190859060001985019081106120a157fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905592909116815260018501909152604090208190555b82548390806120e957fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b03841682526001850190526040812055505050565b6001820154600090600160401b900467ffffffffffffffff1680612153576000915050611515565b438310158061218657506000198101600090815260208590526040902054600160c01b900467ffffffffffffffff168310155b156121ae57600019016000908152602084905260409020546001600160c01b03169050611515565b600184015467ffffffffffffffff9081166000818152602087905260409020549091600160c01b9091041684101561222857801561221d5760405162461bcd60e51b81526004018080602001828103825260308152602001806127c66030913960400191505060405180910390fd5b600092505050611515565b600185015460009061224f9087908490600160401b900467ffffffffffffffff16886125d6565b6000908152602087905260409020546001600160c01b0316935050505092915050565b806122a86005547f0000000000000000000000000000000000000000dbb8481a7362102da00000006116ed90919063ffffffff16565b10156122b057fe5b6122b98161249d565b6005546122c690826117c4565b60055550565b60095460005b8181101561238b57600981815481106122e757fe5b60009182526020909120600490910201546001600160a01b038481169116141561238357604080518082018252601881527f746f6b656e20706f6f6c20616c726561647920616464656400000000000000006020808301918252925162461bcd60e51b81526004810193845282516024820152825192939283926044909201919080838360008315610a65578181015183820152602001610a4d565b6001016122d2565b50600980546001018082556000829052839190839081106123a857fe5b6000918252602090912060049091020180546001600160a01b0319166001600160a01b03929092169190911790555050565b6001600160a01b0381166000908152600183016020526040902054156123ff57611269565b8154600180820184556000848152602080822090930180546001600160a01b0319166001600160a01b03959095169485179055845493815293019052604090912055565b6000600160c01b8210611a2f576040805162461bcd60e51b815260206004820152601d60248201527f76616c756520646f65736e27742066697420696e203139322062697473000000604482015290519081900360640190fd5b610f2a611ca5826124ae600261177b565b906117c4565b60006124c861dead31600160981b316117c4565b90506124e76124e2600d54836116ed90919063ffffffff16565b611c94565b600d55565b600080600e60000180548060200260200160405190810160405280929190818152602001828054801561254857602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161252a575b5050505050905060005b81518110156125955761258b82828151811061256a57fe5b60200260200101516001600160a01b031631846117c490919063ffffffff16565b9250600101612552565b508160105414156125a7575050610aba565b8160105411156125c3576125be826010540361249d565b6125d0565b6125d06010548303611c94565b50601055565b600083816125e58560016116ed565b90505b8181111561265157600061260c600261260660016124ae86886117c4565b9061265b565b600081815260208a90526040902054909150600160c01b900467ffffffffffffffff16851061263d5780925061264b565b6126488160016116ed565b91505b506125e8565b5095945050505050565b60008082116126b1576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816126ba57fe5b049392505050565b50805460018160011615610100020316600290046000825580601f106126e85750610f2a565b601f016020900490600052602060002090810190610f2a919061278a565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928261273c5760008555612782565b82601f1061275557805160ff1916838001178555612782565b82800160010185558215612782579182015b82811115612782578251825591602001919060010190612767565b50611a2f9291505b5b80821115611a2f576000815560010161278b56fe53616665436173743a2076616c756520646f65736e27742066697420696e2036342062697473436865636b506f696e74486973746f72793a2072656164696e672066726f6d20636c65616e65642d757020626c6f636ba2646970667358221220dfbf850ec125d3a9a7af1732d9202d372b828c994fa873f34bdf3be94e1b289164736f6c63430007060033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"libraries":{},"metadata":{"useLiteralContent":true},"optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"":["id","ast"],"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"]}}},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":[["0x4598A6c05910ab914F0CbAAca1911Cd337d10D29",{"internalType":"address","name":"_governance","type":"address"}],["0x4598A6c05910ab914F0CbAAca1911Cd337d10D29",{"internalType":"address","name":"_addressUpdater","type":"address"}],["100000000000000000000000000000",{"internalType":"uint256","name":"_initialGenesisAmountWei","type":"uint256"}],["68000000000000000000000000000",{"internalType":"uint256","name":"_totalExcludedSupplyWei","type":"uint256"}],[[],{"internalType":"contract IITokenPool[]","name":"_tokenPools","type":"address[]"}],[[],{"internalType":"address[]","name":"_foundationAddresses","type":"address[]"}],["0x8577D2D50827bCE2EC1dc9Cf9F1199826781D5AF",{"internalType":"contract IISupply","name":"_oldSupply","type":"address"}]],"compiler_version":"v0.7.6+commit.7338295f","is_verified_via_verifier_alliance":false,"verified_at":"2024-11-18T13:31:10.164815Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60c06040523480156200001157600080fd5b506040516200374b3803806200374b833981810160405260e08110156200003757600080fd5b81516020830151604080850151606086015160808701805193519597949692959194919392820192846401000000008211156200007357600080fd5b9083019060208201858111156200008957600080fd5b8251866020820283011164010000000082111715620000a757600080fd5b82525081516020918201928201910280838360005b83811015620000d6578181015183820152602001620000bc565b50505050905001604052602001805160405193929190846401000000008211156200010057600080fd5b9083019060208201858111156200011657600080fd5b82518660208202830111640100000000821117156200013457600080fd5b82525081516020918201928201910280838360005b838110156200016357818101518382015260200162000149565b50505050919091016040525060200151915086905087806001600160a01b038116156200019557620001958162000452565b506001600160a01b038116620001e5576040805162461bcd60e51b815260206004820152601060248201526f5f676f7665726e616e6365207a65726f60801b604482015290519081900360640190fd5b50620001f18162000515565b5060408051808201909152601b81527f696e697469616c2067656e6573697320616d6f756e74207a65726f0000000000602082015285620002b35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015620002775781810151838201526020016200025d565b50505050905090810190601f168015620002a55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50608085905260a0849052620002e0620002da868662000539602090811b620016ed17901c565b62000597565b60005b83518110156200031b5762000312848281518110620002fe57fe5b6020026020010151620005e460201b60201c565b600101620002e3565b506200033782600e620006f960201b6200174a1790919060201c565b604080516000808252602082019092527f5c3fa658268afebe402cb474fc8481cb13cb4f9230b78161b64024af71ed94989184919050604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015620003b357818101518382015260200162000399565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015620003f4578181015183820152602001620003da565b5050505090500194505050505060405180910390a16001600160a01b038116156200043b57600b80546001600160a01b0319166001600160a01b038316179055600019600c555b620004456200073a565b5050505050505062000ec7565b600054600160a01b900460ff1615620004b2576040805162461bcd60e51b815260206004820152601460248201527f696e697469616c6973656420213d2066616c7365000000000000000000000000604482015290519081900360640190fd5b60008054600160a01b60ff60a01b19909116176001600160a01b0319166001600160a01b03831690811790915560408051918252517f9789733827840833afc031fb2ef9ab6894271f77bad2085687cf4ae5c7bee4db916020908290030190a150565b7f714f205b2abd25bef1d06a1af944e38c113fe6160375c4e1d6d5cf28848e771955565b60008282111562000591576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b620005e1620005cb82620005b760026200097160201b6200177b1760201c565b620009c360201b620017c41790919060201c565b600262000a2560201b620018251790919060201c565b50565b60095460005b81811015620006a957600981815481106200060157fe5b60009182526020909120600490910201546001600160a01b0384811691161415620006a057604080518082018252601881527f746f6b656e20706f6f6c20616c726561647920616464656400000000000000006020808301918252925162461bcd60e51b81526004810193845282516024820152825192939283926044909201919080838360008315620002775781810151838201526020016200025d565b600101620005ea565b5060098054600101808255600082905283919083908110620006c757fe5b6000918252602090912060049091020180546001600160a01b0319166001600160a01b03929092169190911790555050565b60005b815181101562000735576200072c838383815181106200071857fe5b602002602001015162000c2560201b60201c565b600101620006fc565b505050565b60095460005b818110156200095c576000600982815481106200075957fe5b600091825260208220600491820201805460408051632dafdbbf60e01b81529051929550849384936001600160a01b0390931692632dafdbbf92808301926060929182900301818787803b158015620007b157600080fd5b505af1158015620007c6573d6000803e3d6000fd5b505050506040513d6060811015620007dd57600080fd5b508051602080830151604090930151919550919350915081906200080e9085908590620017c4620009c3821b17901c565b10156200081757fe5b6000620008378560020154846200053960201b620016ed1790919060201c565b90506200085581600754620009c360201b620017c41790919060201c565b60078190555060006200087b8660030154846200053960201b620016ed1790919060201c565b9050620008888162000597565b620008a481600854620009c360201b620017c41790919060201c565b60085560018601548510620008eb5760018601548503620008c58162000c94565b620008e181600654620009c360201b620017c41790919060201c565b6006555062000939565b600085876001015403905062000912816005546200053960201b620016ed1790919060201c565b60058190555062000934816006546200053960201b620016ed1790919060201c565b600655505b505060018085019390935560028401919091556003909201919091550162000740565b506200096762000cc8565b620005e162000d17565b60018101546000906801000000000000000090046001600160401b0316806200099f576000915050620009be565b600019016000908152602083905260409020546001600160c01b031690505b919050565b60008282018381101562000a1e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60018201546801000000000000000090046001600160401b03168062000afc57604051806040016040528062000a618462000e1d60201b60201c565b6001600160c01b0316815260200162000a854362000e7c60201b620019eb1760201c565b6001600160401b03908116909152600080805260208681526040909120835181549490920151909216600160c01b026001600160c01b039182166001600160c01b03199094169390931716919091179055600183018054600160401b600160801b0319166801000000000000000017905562000735565b600019810160009081526020849052604090208054600160c01b90046001600160401b03164381141562000b565762000b358462000e1d565b82546001600160c01b0319166001600160c01b039190911617825562000c1e565b80431162000b6057fe5b604051806040016040528062000b7c8662000e1d60201b60201c565b6001600160c01b0316815260200162000ba04362000e7c60201b620019eb1760201c565b6001600160401b039081169091526000858152602088815260409091208351815494909201518316600160c01b026001600160c01b039283166001600160c01b03199095169490941790911692909217909155600180870180549186019092166801000000000000000002600160401b600160801b03199091161790555b5050505050565b6001600160a01b03811660009081526001830160205260409020541562000c4c5762000c90565b8154600180820184556000848152602080822090930180546001600160a01b0319166001600160a01b03861690811790915585549082529185019092526040909120555b5050565b620005e1620005cb8262000cb460026200097160201b6200177b1760201c565b6200053960201b620016ed1790919060201c565b600062000cea61dead31600160981b31620009c3602090811b620017c417901c565b905062000d1262000d0c600d54836200053960201b620016ed1790919060201c565b62000c94565b600d55565b600080600e60000180548060200260200160405190810160405280929190818152602001828054801562000d7557602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000d56575b5050505050905060005b815181101562000dcc5762000dc182828151811062000d9a57fe5b60200260200101516001600160a01b03163184620009c360201b620017c41790919060201c565b925060010162000d7f565b5081601054141562000de057505062000e1b565b81601054111562000e065762000e0082601054036200059760201b60201c565b62000e16565b60105462000e1690830362000c94565b506010555b565b6000600160c01b821062000e78576040805162461bcd60e51b815260206004820152601d60248201527f76616c756520646f65736e27742066697420696e203139322062697473000000604482015290519081900360640190fd5b5090565b600068010000000000000000821062000e785760405162461bcd60e51b8152600401808060200182810382526026815260200180620037256026913960400191505060405180910390fd5b60805160a05161282b62000efa60003980610977528061156b528061227b5250806109ad528061146e525061282b6000f3fe608060405234801561001057600080fd5b50600436106101ef5760003560e01c80639f71043e1161010f578063d9330e63116100a2578063e433f81811610071578063e433f818146106f6578063efac34cc146106fe578063efcf7eb214610756578063f5a9838314610782576101ef565b8063d9330e6314610698578063dc2603bb146106b5578063df3d9b73146106bd578063e17f212e146106da576101ef565b8063be0522e0116100de578063be0522e014610678578063bfebbd2614610680578063c6faaafa14610688578063d0c1c39314610690576101ef565b80639f71043e1461040d578063a2420e2014610415578063b00c0b7614610432578063b646900414610555576101ef565b80635aa6e6751161018757806367fc40291161015657806367fc40291461031257806370d5ae051461033957806374e6310e146103415780639d6a890f146103e7576101ef565b80635aa6e675146102be5780635ff27079146102c65780636159b0a3146102ed57806362354e031461030a576101ef565b80631b73b4cb116101c35780631b73b4cb1461029c57806332ae2927146102a45780633c8c461c146102ac5780635267a15d146102b6576101ef565b8062c0f916146101f4578063037b0890146102415780630585084414610270578063099eea6214610294575b600080fd5b6102116004803603602081101561020a57600080fd5b503561078a565b604080516001600160a01b0390951685526020850193909352838301919091526060830152519081900360800190f35b61025e6004803603602081101561025757600080fd5b50356107ce565b60408051918252519081900360200190f35b6102786108c4565b604080516001600160a01b039092168252519081900360200190f35b61025e6108d3565b61025e6108d9565b61025e6109de565b6102b46109e4565b005b610278610abc565b610278610ae1565b6102b4600480360360208110156102dc57600080fd5b50356001600160e01b031916610b75565b6102b46004803603602081101561030357600080fd5b5035610eca565b610278610f2d565b6102b46004803603602081101561032857600080fd5b50356001600160e01b031916610f38565b610278611020565b6103686004803603602081101561035757600080fd5b50356001600160e01b031916611026565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156103ab578181015183820152602001610393565b50505050905090810190601f1680156103d85780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b6102b4600480360360208110156103fd57600080fd5b50356001600160a01b03166110cc565b61025e611185565b6102b46004803603602081101561042b57600080fd5b503561118b565b6102b46004803603604081101561044857600080fd5b810190602081018135600160201b81111561046257600080fd5b82018360208201111561047457600080fd5b803590602001918460208302840111600160201b8311171561049557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156104e457600080fd5b8201836020820111156104f657600080fd5b803590602001918460208302840111600160201b8311171561051757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061126d945050505050565b6102b46004803603604081101561056b57600080fd5b810190602081018135600160201b81111561058557600080fd5b82018360208201111561059757600080fd5b803590602001918460208302840111600160201b831117156105b857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561060757600080fd5b82018360208201111561061957600080fd5b803590602001918460208302840111600160201b8311171561063a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611314945050505050565b61027861145d565b61025e61146c565b610278611490565b61025e611498565b61025e600480360360208110156106ae57600080fd5b503561149e565b61025e61151b565b6102b4600480360360208110156106d357600080fd5b5035611521565b6106e2611559565b604080519115158252519081900360200190f35b61025e611569565b61070661158d565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561074257818101518382015260200161072a565b505050509050019250505060405180910390f35b6102b46004803603604081101561076c57600080fd5b506001600160a01b0381351690602001356115f2565b6102b4611633565b6009818154811061079a57600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169350919084565b6000438210610824576040805162461bcd60e51b815260206004820181905260248201527f43616e206f6e6c79206265207573656420666f72207061737420626c6f636b73604482015290519081900360640190fd5b600c548210156108ae57600b54604080516237b08960e41b81526004810185905290516001600160a01b039092169163037b0890916024808201926020929091908290030181600087803b15801561087b57600080fd5b505af115801561088f573d6000803e3d6000fd5b505050506040513d60208110156108a557600080fd5b505190506108bf565b6108bb6004600284611a33565b5090505b919050565b600b546001600160a01b031681565b60055481565b6000600c5443101561096657600b60009054906101000a90046001600160a01b03166001600160a01b0316631b73b4cb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561093357600080fd5b505afa158015610947573d6000803e3d6000fd5b505050506040513d602081101561095d57600080fd5b505190506109db565b6109d86006546109d26109a46005547f00000000000000000000000000000000000000000000000000000000000000006116ed90919063ffffffff16565b6008546109d2907f0000000000000000000000000000000000000000000000000000000000000000906117c4565b906116ed565b90505b90565b60065481565b600a5460408051808201909152600e81526d696e666c6174696f6e206f6e6c7960901b6020820152906001600160a01b03163314610aa05760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a65578181015183820152602001610a4d565b50505050905090810190601f168015610a925780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600019600c541415610ab25743600c555b610aba611a91565b565b7f714f205b2abd25bef1d06a1af944e38c113fe6160375c4e1d6d5cf28848e77195490565b60008054600160a81b900460ff16610b04576000546001600160a01b03166109d8565b60076001609c1b016001600160a01b031663732524946040518163ffffffff1660e01b815260040160206040518083038186803b158015610b4457600080fd5b505afa158015610b58573d6000803e3d6000fd5b505050506040513d6020811015610b6e57600080fd5b5051905090565b60408051630debfda360e41b8152336004820152905160076001609c1b019163debfda30916024808301926020929190829003018186803b158015610bb957600080fd5b505afa158015610bcd573d6000803e3d6000fd5b505050506040513d6020811015610be357600080fd5b5051610c26576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9032bc32b1baba37b960991b604482015290519081900360640190fd5b6001600160e01b0319811660009081526001602052604090208054610c92576040805162461bcd60e51b815260206004820152601a60248201527f74696d656c6f636b3a20696e76616c69642073656c6563746f72000000000000604482015290519081900360640190fd5b8054421015610ce8576040805162461bcd60e51b815260206004820152601960248201527f74696d656c6f636b3a206e6f7420616c6c6f7765642079657400000000000000604482015290519081900360640190fd5b6000816001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050506001600160e01b0319861660009081526001602081905260408220828155949550909250610db691508301826126c2565b50506000805460ff60b01b1916600160b01b178155604051825130918491819060208401908083835b60208310610dfe5780518252601f199092019160209182019101610ddf565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610e60576040519150601f19603f3d011682016040523d82523d6000602084013e610e65565b606091505b50506000805460ff60b01b19169055604080516001600160e01b03198716815242602082015281519293507fa7326b57fc9cfe267aaea5e7f0b01757154d265620a0585819416ee9ddd2c438929081900390910190a1610ec481611c42565b50505050565b600054600160b01b900460ff1680610eec5750600054600160a81b900460ff16155b15610f1f57610ef9611c5f565b600554610f0690826116ed565b600555610f1281611c94565b610f1a611a91565b610f2a565b610f2a600036611cad565b50565b60076001609c1b0181565b610f40611e30565b6001600160e01b03198116600090815260016020526040902054610fab576040805162461bcd60e51b815260206004820152601a60248201527f74696d656c6f636b3a20696e76616c69642073656c6563746f72000000000000604482015290519081900360640190fd5b604080516001600160e01b03198316815242602082015281517f7735b2391c38a81419c513e30ca578db7158eadd7101511b23e221c654d19cf8929181900390910190a16001600160e01b0319811660009081526001602081905260408220828155919061101b908301826126c2565b505050565b61dead90565b600160208181526000928352604092839020805481840180548651600296821615610100026000190190911695909504601f810185900485028601850190965285855290949193929091908301828280156110c25780601f10611097576101008083540402835291602001916110c2565b820191906000526020600020905b8154815290600101906020018083116110a557829003601f168201915b5050505050905082565b600054600160a01b900460ff1615611122576040805162461bcd60e51b8152602060048201526014602482015273696e697469616c6973656420213d2066616c736560601b604482015290519081900360640190fd5b60008054600160a01b60ff60a01b19909116176001600160a01b0319166001600160a01b03831690811790915560408051918252517f9789733827840833afc031fb2ef9ab6894271f77bad2085687cf4ae5c7bee4db916020908290030190a150565b60085481565b600a5460408051808201909152600e81526d696e666c6174696f6e206f6e6c7960901b6020820152906001600160a01b0316331461120a5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610a65578181015183820152602001610a4d565b50600754611216611a91565b61122081836117c4565b6007541461126957600754604080519183900382526020820184905280517feeb8970a03ae6e5930263b6b2553da66b8e20080d79a3f33c139e5855574eb739281900390910190a15b5050565b611275610abc565b6001600160a01b0316336001600160a01b0316146112d1576040805162461bcd60e51b815260206004820152601460248201527337b7363c9030b2323932b9b9903ab83230ba32b960611b604482015290519081900360640190fd5b61130a61130583836040518060400160405280600e81526020016d20b2323932b9b9aab83230ba32b960911b815250611e8f565b611fbc565b6112698282611fe0565b600054600160b01b900460ff16806113365750600054600160a81b900460ff16155b1561145257611343611c5f565b7f5c3fa658268afebe402cb474fc8481cb13cb4f9230b78161b64024af71ed94988282604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156113aa578181015183820152602001611392565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156113e95781810151838201526020016113d1565b5050505090500194505050505060405180910390a160005b81518110156114395761143182828151811061141957fe5b6020026020010151600e61203090919063ffffffff16565b600101611401565b50611445600e8361174a565b61144d611a91565b611269565b611269600036611cad565b600a546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b600160981b90565b60075481565b6000600c5482101561150a57600b546040805163d9330e6360e01b81526004810185905290516001600160a01b039092169163d9330e6391602480820192602092909190829003018186803b1580156114f657600080fd5b505afa15801561088f573d6000803e3d6000fd5b61151560028361212b565b92915050565b600c5481565b600054600160b01b900460ff16806115435750600054600160a81b900460ff16155b15610f1f57611550611c5f565b610f1281612272565b600054600160a81b900460ff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b6060600e6000018054806020026020016040519081016040528092919081815260200182805480156115e857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116115ca575b5050505050905090565b600054600160b01b900460ff16806116145750600054600160a81b900460ff16155b1561145257611621611c5f565b61162a81612272565b611445826122cc565b61163b611e30565b600054600160a81b900460ff161561169a576040805162461bcd60e51b815260206004820152601a60248201527f616c726561647920696e2070726f64756374696f6e206d6f6465000000000000604482015290519081900360640190fd5b60008054600161ff0160a01b031916600160a81b1790556040805160076001609c1b01815290517f83af113638b5422f9e977cebc0aaf0eaf2188eb9a8baae7f9d46c42b33a1560c9181900360200190a1565b600082821115611744576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60005b815181101561101b576117738383838151811061176657fe5b60200260200101516123da565b60010161174d565b6001810154600090600160401b900467ffffffffffffffff16806117a35760009150506108bf565b6000190160009081526020929092525060409020546001600160c01b031690565b60008282018381101561181e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001820154600160401b900467ffffffffffffffff16806118de57604051806040016040528061185484612443565b6001600160c01b0316815260200161186b436119eb565b67ffffffffffffffff908116909152600080805260208681526040909120835181549490920151909216600160c01b026001600160c01b039182166001600160c01b0319909416939093171691909117905560018301805467ffffffffffffffff60401b1916600160401b17905561101b565b600019810160009081526020849052604090208054600160c01b900467ffffffffffffffff16438114156119355761191584612443565b82546001600160c01b0319166001600160c01b03919091161782556119e4565b80431161193e57fe5b604051806040016040528061195286612443565b6001600160c01b03168152602001611969436119eb565b67ffffffffffffffff9081169091526000858152602088815260409091208351815494909201518316600160c01b026001600160c01b039283166001600160c01b0319909516949094179091169290921790915560018087018054918601909216600160401b0267ffffffffffffffff60401b199091161790555b5050505050565b6000600160401b8210611a2f5760405162461bcd60e51b81526004018080602001828103825260268152602001806127a06026913960400191505060405180910390fd5b5090565b60008181526020849052604081205481908015611a595760001901915060009050611a89565b6000611a65868661212b565b9050611a728160016117c4565b600086815260208990526040902055925060019150505b935093915050565b60095460005b81811015611c3157600060098281548110611aae57fe5b600091825260208220600491820201805460408051632dafdbbf60e01b81529051929550849384936001600160a01b0390931692632dafdbbf92808301926060929182900301818787803b158015611b0557600080fd5b505af1158015611b19573d6000803e3d6000fd5b505050506040513d6060811015611b2f57600080fd5b5080516020820151604090920151909450909250905080611b5084846117c4565b1015611b5857fe5b6000611b718560020154846116ed90919063ffffffff16565b600754909150611b8190826117c4565b6007556003850154600090611b979084906116ed565b9050611ba28161249d565b600854611baf90826117c4565b60085560018601548510611be35760018601548503611bcd81611c94565b600654611bda90826117c4565b60065550611c0f565b60018601546005549086900390611bfa90826116ed565b600555600654611c0a90826116ed565b600655505b5050600180850193909355600284019190915560039092019190915501611a97565b50611c3a6124b4565b610f2a6124ec565b3d604051818101604052816000823e8215611c5b578181f35b8181fd5b600054600160b01b900460ff1615611c8c57333014611c7a57fe5b6000805460ff60b01b19169055610aba565b610aba611e30565b610f2a611ca5826109d2600261177b565b600290611825565b611cb5611e30565b600082359050600060076001609c1b016001600160a01b0316636221a54b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611cfd57600080fd5b505afa158015611d11573d6000803e3d6000fd5b505050506040513d6020811015611d2757600080fd5b505160408051808201825242830180825282516020601f89018190048102820181019094528781529394509290918281019190889088908190840183828082843760009201829052509390945250506001600160e01b03198616815260016020818152604090922084518155848301518051919450611dab93928501920190612706565b509050507fed948300a3694aa01d4a6b258bfd664350193d770c0b51f8387277f6d83ea3b68382878760405180856001600160e01b0319168152602001848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f191690920182900397509095505050505050a15050505050565b611e38610ae1565b6001600160a01b0316336001600160a01b031614610aba576040805162461bcd60e51b815260206004820152600f60248201526e6f6e6c7920676f7665726e616e636560881b604482015290519081900360640190fd5b600080826040516020018080602001828103825283818151815260200191508051906020019080838360005b83811015611ed3578181015183820152602001611ebb565b50505050905090810190601f168015611f005780820380516001836020036101000a031916815260200191505b50925050506040516020818303038152906040528051906020012090506000805b8651811015611f6857868181518110611f3657fe5b6020026020010151831415611f6057858181518110611f5157fe5b60200260200101519150611f68565b600101611f21565b506001600160a01b038116611fb3576040805162461bcd60e51b815260206004820152600c60248201526b61646472657373207a65726f60a01b604482015290519081900360640190fd5b95945050505050565b7f714f205b2abd25bef1d06a1af944e38c113fe6160375c4e1d6d5cf28848e771955565b61200c82826040518060400160405280600981526020016824b7333630ba34b7b760b91b815250611e8f565b600a80546001600160a01b0319166001600160a01b03929092169190911790555050565b6001600160a01b0381166000908152600183016020526040902054806120565750611269565b82548110156120de5782546000908490600019810190811061207457fe5b60009182526020909120015484546001600160a01b0390911691508190859060001985019081106120a157fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905592909116815260018501909152604090208190555b82548390806120e957fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b03841682526001850190526040812055505050565b6001820154600090600160401b900467ffffffffffffffff1680612153576000915050611515565b438310158061218657506000198101600090815260208590526040902054600160c01b900467ffffffffffffffff168310155b156121ae57600019016000908152602084905260409020546001600160c01b03169050611515565b600184015467ffffffffffffffff9081166000818152602087905260409020549091600160c01b9091041684101561222857801561221d5760405162461bcd60e51b81526004018080602001828103825260308152602001806127c66030913960400191505060405180910390fd5b600092505050611515565b600185015460009061224f9087908490600160401b900467ffffffffffffffff16886125d6565b6000908152602087905260409020546001600160c01b0316935050505092915050565b806122a86005547f00000000000000000000000000000000000000000000000000000000000000006116ed90919063ffffffff16565b10156122b057fe5b6122b98161249d565b6005546122c690826117c4565b60055550565b60095460005b8181101561238b57600981815481106122e757fe5b60009182526020909120600490910201546001600160a01b038481169116141561238357604080518082018252601881527f746f6b656e20706f6f6c20616c726561647920616464656400000000000000006020808301918252925162461bcd60e51b81526004810193845282516024820152825192939283926044909201919080838360008315610a65578181015183820152602001610a4d565b6001016122d2565b50600980546001018082556000829052839190839081106123a857fe5b6000918252602090912060049091020180546001600160a01b0319166001600160a01b03929092169190911790555050565b6001600160a01b0381166000908152600183016020526040902054156123ff57611269565b8154600180820184556000848152602080822090930180546001600160a01b0319166001600160a01b03959095169485179055845493815293019052604090912055565b6000600160c01b8210611a2f576040805162461bcd60e51b815260206004820152601d60248201527f76616c756520646f65736e27742066697420696e203139322062697473000000604482015290519081900360640190fd5b610f2a611ca5826124ae600261177b565b906117c4565b60006124c861dead31600160981b316117c4565b90506124e76124e2600d54836116ed90919063ffffffff16565b611c94565b600d55565b600080600e60000180548060200260200160405190810160405280929190818152602001828054801561254857602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161252a575b5050505050905060005b81518110156125955761258b82828151811061256a57fe5b60200260200101516001600160a01b031631846117c490919063ffffffff16565b9250600101612552565b508160105414156125a7575050610aba565b8160105411156125c3576125be826010540361249d565b6125d0565b6125d06010548303611c94565b50601055565b600083816125e58560016116ed565b90505b8181111561265157600061260c600261260660016124ae86886117c4565b9061265b565b600081815260208a90526040902054909150600160c01b900467ffffffffffffffff16851061263d5780925061264b565b6126488160016116ed565b91505b506125e8565b5095945050505050565b60008082116126b1576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816126ba57fe5b049392505050565b50805460018160011615610100020316600290046000825580601f106126e85750610f2a565b601f016020900490600052602060002090810190610f2a919061278a565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928261273c5760008555612782565b82601f1061275557805160ff1916838001178555612782565b82800160010185558215612782579182015b82811115612782578251825591602001919060010190612767565b50611a2f9291505b5b80821115611a2f576000815560010161278b56fe53616665436173743a2076616c756520646f65736e27742066697420696e2036342062697473436865636b506f696e74486973746f72793a2072656164696e672066726f6d20636c65616e65642d757020626c6f636ba2646970667358221220dfbf850ec125d3a9a7af1732d9202d372b828c994fa873f34bdf3be94e1b289164736f6c6343000706003353616665436173743a2076616c756520646f65736e27742066697420696e20363420626974730000000000000000000000004598a6c05910ab914f0cbaaca1911cd337d10d290000000000000000000000004598a6c05910ab914f0cbaaca1911cd337d10d290000000000000000000000000000000000000001431e0fae6d7217caa00000000000000000000000000000000000000000000000dbb8481a7362102da000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000008577d2d50827bce2ec1dc9cf9f1199826781d5af00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","name":"Supply","is_blueprint":false,"license_type":"none","is_fully_verified":false,"is_verified_via_eth_bytecode_db":false,"language":"solidity","evm_version":"default","can_be_visualized_via_sol2uml":false,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"./contracts/tokenPools/interface/IITokenPool.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity >=0.7.6 <0.9;\n\ninterface IITokenPool {\n\n    /**\n     * @notice Return token pool supply data\n     * @return _lockedFundsWei                  Funds that are intentionally locked in the token pool \n     * and not part of circulating supply\n     * @return _totalInflationAuthorizedWei     Total inflation authorized amount (wei)\n     * @return _totalClaimedWei                 Total claimed amount (wei)\n     */\n    function getTokenPoolSupplyData() external returns (\n        uint256 _lockedFundsWei,\n        uint256 _totalInflationAuthorizedWei,\n        uint256 _totalClaimedWei\n    );\n}\n"},{"file_path":"./contracts/addressUpdater/implementation/AddressUpdatable.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\nimport \"../interface/IIAddressUpdatable.sol\";\n\n\nabstract contract AddressUpdatable is IIAddressUpdatable {\n\n    // https://docs.soliditylang.org/en/v0.8.7/contracts.html#constant-and-immutable-state-variables\n    // No storage slot is allocated\n    bytes32 internal constant ADDRESS_STORAGE_POSITION = \n        keccak256(\"flare.diamond.AddressUpdatable.ADDRESS_STORAGE_POSITION\");\n\n    modifier onlyAddressUpdater() {\n        require (msg.sender == getAddressUpdater(), \"only address updater\");\n        _;\n    }\n\n    constructor(address _addressUpdater) {\n        setAddressUpdaterValue(_addressUpdater);\n    }\n\n    function getAddressUpdater() public view returns (address _addressUpdater) {\n        // Only direct constants are allowed in inline assembly, so we assign it here\n        bytes32 position = ADDRESS_STORAGE_POSITION;\n        // solhint-disable-next-line no-inline-assembly\n        assembly {\n            _addressUpdater := sload(position)\n        }\n    }\n\n    /**\n     * @notice external method called from AddressUpdater only\n     */\n    function updateContractAddresses(\n        bytes32[] memory _contractNameHashes,\n        address[] memory _contractAddresses\n    )\n        external override\n        onlyAddressUpdater\n    {\n        // update addressUpdater address\n        setAddressUpdaterValue(_getContractAddress(_contractNameHashes, _contractAddresses, \"AddressUpdater\"));\n        // update all other addresses\n        _updateContractAddresses(_contractNameHashes, _contractAddresses);\n    }\n\n    /**\n     * @notice virtual method that a contract extending AddressUpdatable must implement\n     */\n    function _updateContractAddresses(\n        bytes32[] memory _contractNameHashes,\n        address[] memory _contractAddresses\n    ) internal virtual;\n\n    /**\n     * @notice helper method to get contract address\n     * @dev it reverts if contract name does not exist\n     */\n    function _getContractAddress(\n        bytes32[] memory _nameHashes,\n        address[] memory _addresses,\n        string memory _nameToFind\n    )\n        internal pure\n        returns(address)\n    {\n        bytes32 nameHash = keccak256(abi.encode(_nameToFind));\n        address a = address(0);\n        for (uint256 i = 0; i < _nameHashes.length; i++) {\n            if (nameHash == _nameHashes[i]) {\n                a = _addresses[i];\n                break;\n            }\n        }\n        require(a != address(0), \"address zero\");\n        return a;\n    }\n\n    function setAddressUpdaterValue(address _addressUpdater) internal {\n        // Only direct constants are allowed in inline assembly, so we assign it here\n        bytes32 position = ADDRESS_STORAGE_POSITION;\n        // solhint-disable-next-line no-inline-assembly  \n        assembly {\n            sstore(position, _addressUpdater)\n        }\n    }\n}\n"},{"file_path":"./contracts/addressUpdater/interface/IIAddressUpdatable.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity >=0.7.6 <0.9;\n\n\ninterface IIAddressUpdatable {\n    /**\n     * @notice Updates contract addresses - should be called only from AddressUpdater contract\n     * @param _contractNameHashes       list of keccak256(abi.encode(...)) contract names\n     * @param _contractAddresses        list of contract addresses corresponding to the contract names\n     */\n    function updateContractAddresses(\n        bytes32[] memory _contractNameHashes,\n        address[] memory _contractAddresses\n        ) external;\n}\n"},{"file_path":"./contracts/governance/implementation/Governed.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\nimport { GovernedBase } from \"./GovernedBase.sol\";\n\n\n/**\n * @title Governed\n * @dev For deployed, governed contracts, enforce a non-zero address at create time.\n **/\ncontract Governed is GovernedBase {\n    constructor(address _governance) GovernedBase(_governance) {\n        require(_governance != address(0), \"_governance zero\");\n    }\n}\n"},{"file_path":"./contracts/governance/implementation/GovernedBase.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\nimport \"../../userInterfaces/IGovernanceSettings.sol\";\n\n\n/**\n * @title Governed Base\n * @notice This abstract base class defines behaviors for a governed contract.\n * @dev This class is abstract so that specific behaviors can be defined for the constructor.\n *   Contracts should not be left ungoverned, but not all contract will have a constructor\n *   (for example those pre-defined in genesis).\n **/\nabstract contract GovernedBase {\n    struct TimelockedCall {\n        uint256 allowedAfterTimestamp;\n        bytes encodedCall;\n    }\n    \n    // solhint-disable-next-line const-name-snakecase\n    IGovernanceSettings public constant governanceSettings = \n        IGovernanceSettings(0x1000000000000000000000000000000000000007);\n\n    address private initialGovernance;\n\n    bool private initialised;\n    \n    bool public productionMode;\n    \n    bool private executing;\n    \n    mapping(bytes4 => TimelockedCall) public timelockedCalls;\n    \n    event GovernanceCallTimelocked(bytes4 selector, uint256 allowedAfterTimestamp, bytes encodedCall);\n    event TimelockedGovernanceCallExecuted(bytes4 selector, uint256 timestamp);\n    event TimelockedGovernanceCallCanceled(bytes4 selector, uint256 timestamp);\n    \n    event GovernanceInitialised(address initialGovernance);\n    event GovernedProductionModeEntered(address governanceSettings);\n    \n    modifier onlyGovernance {\n        if (executing || !productionMode) {\n            _beforeExecute();\n            _;\n        } else {\n            _recordTimelockedCall(msg.data);\n        }\n    }\n    \n    modifier onlyImmediateGovernance () {\n        _checkOnlyGovernance();\n        _;\n    }\n\n    constructor(address _initialGovernance) {\n        if (_initialGovernance != address(0)) {\n            initialise(_initialGovernance);\n        }\n    }\n\n    /**\n     * @notice Execute the timelocked governance calls once the timelock period expires.\n     * @dev Only executor can call this method.\n     * @param _selector The method selector (only one timelocked call per method is stored).\n     */\n    function executeGovernanceCall(bytes4 _selector) external {\n        require(governanceSettings.isExecutor(msg.sender), \"only executor\");\n        TimelockedCall storage call = timelockedCalls[_selector];\n        require(call.allowedAfterTimestamp != 0, \"timelock: invalid selector\");\n        require(block.timestamp >= call.allowedAfterTimestamp, \"timelock: not allowed yet\");\n        bytes memory encodedCall = call.encodedCall;\n        delete timelockedCalls[_selector];\n        executing = true;\n        //solhint-disable-next-line avoid-low-level-calls\n        (bool success,) = address(this).call(encodedCall);\n        executing = false;\n        emit TimelockedGovernanceCallExecuted(_selector, block.timestamp);\n        _passReturnOrRevert(success);\n    }\n    \n    /**\n     * Cancel a timelocked governance call before it has been executed.\n     * @dev Only governance can call this method.\n     * @param _selector The method selector.\n     */\n    function cancelGovernanceCall(bytes4 _selector) external onlyImmediateGovernance {\n        require(timelockedCalls[_selector].allowedAfterTimestamp != 0, \"timelock: invalid selector\");\n        emit TimelockedGovernanceCallCanceled(_selector, block.timestamp);\n        delete timelockedCalls[_selector];\n    }\n    \n    /**\n     * Enter the production mode after all the initial governance settings have been set.\n     * This enables timelocks and the governance is afterwards obtained by calling \n     * governanceSettings.getGovernanceAddress(). \n     */\n    function switchToProductionMode() external {\n        _checkOnlyGovernance();\n        require(!productionMode, \"already in production mode\");\n        initialGovernance = address(0);\n        productionMode = true;\n        emit GovernedProductionModeEntered(address(governanceSettings));\n    }\n\n    /**\n     * @notice Initialize the governance address if not first initialized.\n     */\n    function initialise(address _initialGovernance) public virtual {\n        require(initialised == false, \"initialised != false\");\n        initialised = true;\n        initialGovernance = _initialGovernance;\n        emit GovernanceInitialised(_initialGovernance);\n    }\n    \n    /**\n     * Returns the current effective governance address.\n     */\n    function governance() public view returns (address) {\n        return productionMode ? governanceSettings.getGovernanceAddress() : initialGovernance;\n    }\n\n    function _beforeExecute() private {\n        if (executing) {\n            // can only be run from executeGovernanceCall(), where we check that only executor can call\n            // make sure nothing else gets executed, even in case of reentrancy\n            assert(msg.sender == address(this));\n            executing = false;\n        } else {\n            // must be called with: productionMode=false\n            // must check governance in this case\n            _checkOnlyGovernance();\n        }\n    }\n\n    function _recordTimelockedCall(bytes calldata _data) private {\n        _checkOnlyGovernance();\n        bytes4 selector;\n        //solhint-disable-next-line no-inline-assembly\n        assembly {\n            selector := calldataload(_data.offset)\n        }\n        uint256 timelock = governanceSettings.getTimelock();\n        uint256 allowedAt = block.timestamp + timelock;\n        timelockedCalls[selector] = TimelockedCall({\n            allowedAfterTimestamp: allowedAt,\n            encodedCall: _data\n        });\n        emit GovernanceCallTimelocked(selector, allowedAt, _data);\n    }\n    \n    function _checkOnlyGovernance() private view {\n        require(msg.sender == governance(), \"only governance\");\n    }\n    \n    function _passReturnOrRevert(bool _success) private pure {\n        // pass exact return or revert data - needs to be done in assembly\n        //solhint-disable-next-line no-inline-assembly\n        assembly {\n            let size := returndatasize()\n            let ptr := mload(0x40)\n            mstore(0x40, add(ptr, size))\n            returndatacopy(ptr, 0, size)\n            if _success {\n                return(ptr, size)\n            }\n            revert(ptr, size)\n        }\n    }\n}\n"},{"file_path":"./contracts/inflation/interface/IISupply.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity >=0.7.6 <0.9;\n\n\ninterface IISupply {\n\n    /**\n     * @notice Updates circulating supply\n     * @dev Also updates the burn address amount\n    */\n    function updateCirculatingSupply() external;\n\n    /**\n     * @notice Updates authorized inflation and circulating supply - emits event if error\n     * @param _inflationAuthorizedWei               Authorized inflation\n     * @dev Also updates the burn address amount\n    */\n    function updateAuthorizedInflationAndCirculatingSupply(uint256 _inflationAuthorizedWei) external;\n\n    /**\n     * @notice Get approximate circulating supply for given block number from cache - only past block\n     * @param _blockNumber                          Block number\n     * @return _circulatingSupplyWei Return approximate circulating supply for last known block <= _blockNumber\n    */\n    function getCirculatingSupplyAtCached(uint256 _blockNumber) external returns(uint256 _circulatingSupplyWei);\n\n    /**\n     * @notice Get approximate circulating supply for given block number\n     * @param _blockNumber                          Block number\n     * @return _circulatingSupplyWei Return approximate circulating supply for last known block <= _blockNumber\n    */\n    function getCirculatingSupplyAt(uint256 _blockNumber) external view returns(uint256 _circulatingSupplyWei);\n\n    /**\n     * @notice Get total inflatable balance (initial genesis amount + total authorized inflation)\n     * @return _inflatableBalanceWei Return inflatable balance\n    */\n    function getInflatableBalance() external view returns(uint256 _inflatableBalanceWei);\n}\n"},{"file_path":"./contracts/token/lib/CheckPointHistory.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\nimport \"@openzeppelin/contracts/math/Math.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/utils/SafeCast.sol\";\n\n\n/**\n * @title Check Point History library\n * @notice A contract to manage checkpoints as of a given block.\n * @dev Store value history by block number with detachable state.\n **/\nlibrary CheckPointHistory {\n    using SafeMath for uint256;\n    using SafeCast for uint256;\n\n    /**\n     * @dev `CheckPoint` is the structure that attaches a block number to a\n     *  given value; the block number attached is the one that last changed the\n     *  value\n     **/\n    struct CheckPoint {\n        // `value` is the amount of tokens at a specific block number\n        uint192 value;\n        // `fromBlock` is the block number that the value was generated from\n        uint64 fromBlock;\n    }\n\n    struct CheckPointHistoryState {\n        // `checkpoints` is an array that tracks values at non-contiguous block numbers\n        mapping(uint256 => CheckPoint) checkpoints;\n        // `checkpoints` before `startIndex` have been deleted\n        // INVARIANT: checkpoints.endIndex == 0 || startIndex < checkpoints.endIndex      (strict!)\n        // startIndex and endIndex are both less then fromBlock, so 64 bits is enough\n        uint64 startIndex;\n        // the index AFTER last\n        uint64 endIndex;\n    }\n\n    /**\n     * @notice Binary search of _checkpoints array.\n     * @param _checkpoints An array of CheckPoint to search.\n     * @param _startIndex Smallest possible index to be returned.\n     * @param _blockNumber The block number to search for.\n     */\n    function _indexOfGreatestBlockLessThan(\n        mapping(uint256 => CheckPoint) storage _checkpoints, \n        uint256 _startIndex,\n        uint256 _endIndex,\n        uint256 _blockNumber\n    )\n        private view \n        returns (uint256 index)\n    {\n        // Binary search of the value by given block number in the array\n        uint256 min = _startIndex;\n        uint256 max = _endIndex.sub(1);\n        while (max > min) {\n            uint256 mid = (max.add(min).add(1)).div(2);\n            if (_checkpoints[mid].fromBlock <= _blockNumber) {\n                min = mid;\n            } else {\n                max = mid.sub(1);\n            }\n        }\n        return min;\n    }\n\n    /**\n     * @notice Queries the value at a specific `_blockNumber`\n     * @param _self A CheckPointHistoryState instance to manage.\n     * @param _blockNumber The block number of the value active at that time\n     * @return _value The value at `_blockNumber`     \n     **/\n    function valueAt(\n        CheckPointHistoryState storage _self, \n        uint256 _blockNumber\n    )\n        internal view \n        returns (uint256 _value)\n    {\n        uint256 historyCount = _self.endIndex;\n\n        // No _checkpoints, return 0\n        if (historyCount == 0) return 0;\n\n        // Shortcut for the actual value (extra optimized for current block, to save one storage read)\n        // historyCount - 1 is safe, since historyCount != 0\n        if (_blockNumber >= block.number || _blockNumber >= _self.checkpoints[historyCount - 1].fromBlock) {\n            return _self.checkpoints[historyCount - 1].value;\n        }\n        \n        // guard values at start    \n        uint256 startIndex = _self.startIndex;\n        if (_blockNumber < _self.checkpoints[startIndex].fromBlock) {\n            // reading data before `startIndex` is only safe before first cleanup\n            require(startIndex == 0, \"CheckPointHistory: reading from cleaned-up block\");\n            return 0;\n        }\n\n        // Find the block with number less than or equal to block given\n        uint256 index = _indexOfGreatestBlockLessThan(_self.checkpoints, startIndex, _self.endIndex, _blockNumber);\n\n        return _self.checkpoints[index].value;\n    }\n\n    /**\n     * @notice Queries the value at `block.number`\n     * @param _self A CheckPointHistoryState instance to manage.\n     * @return _value The value at `block.number`\n     **/\n    function valueAtNow(CheckPointHistoryState storage _self) internal view returns (uint256 _value) {\n        uint256 historyCount = _self.endIndex;\n        // No _checkpoints, return 0\n        if (historyCount == 0) return 0;\n        // Return last value\n        return _self.checkpoints[historyCount - 1].value;\n    }\n\n    /**\n     * @notice Writes the value at the current block.\n     * @param _self A CheckPointHistoryState instance to manage.\n     * @param _value Value to write.\n     **/\n    function writeValue(\n        CheckPointHistoryState storage _self, \n        uint256 _value\n    )\n        internal\n    {\n        uint256 historyCount = _self.endIndex;\n        if (historyCount == 0) {\n            // checkpoints array empty, push new CheckPoint\n            _self.checkpoints[0] = \n                CheckPoint({ fromBlock: block.number.toUint64(), value: _toUint192(_value) });\n            _self.endIndex = 1;\n        } else {\n            // historyCount - 1 is safe, since historyCount != 0\n            CheckPoint storage lastCheckpoint = _self.checkpoints[historyCount - 1];\n            uint256 lastBlock = lastCheckpoint.fromBlock;\n            // slither-disable-next-line incorrect-equality\n            if (block.number == lastBlock) {\n                // If last check point is the current block, just update\n                lastCheckpoint.value = _toUint192(_value);\n            } else {\n                // we should never have future blocks in history\n                assert (block.number > lastBlock);\n                // push new CheckPoint\n                _self.checkpoints[historyCount] = \n                    CheckPoint({ fromBlock: block.number.toUint64(), value: _toUint192(_value) });\n                _self.endIndex = uint64(historyCount + 1);  // 64 bit safe, because historyCount <= block.number\n            }\n        }\n    }\n    \n    /**\n     * Delete at most `_count` of the oldest checkpoints.\n     * At least one checkpoint at or before `_cleanupBlockNumber` will remain \n     * (unless the history was empty to start with).\n     */    \n    function cleanupOldCheckpoints(\n        CheckPointHistoryState storage _self, \n        uint256 _count,\n        uint256 _cleanupBlockNumber\n    )\n        internal\n        returns (uint256)\n    {\n        if (_cleanupBlockNumber == 0) return 0;   // optimization for when cleaning is not enabled\n        uint256 length = _self.endIndex;\n        if (length == 0) return 0;\n        uint256 startIndex = _self.startIndex;\n        // length - 1 is safe, since length != 0 (check above)\n        uint256 endIndex = Math.min(startIndex.add(_count), length - 1);    // last element can never be deleted\n        uint256 index = startIndex;\n        // we can delete `checkpoint[index]` while the next checkpoint is at `_cleanupBlockNumber` or before\n        while (index < endIndex && _self.checkpoints[index + 1].fromBlock <= _cleanupBlockNumber) {\n            delete _self.checkpoints[index];\n            index++;\n        }\n        if (index > startIndex) {   // index is the first not deleted index\n            _self.startIndex = index.toUint64();\n        }\n        return index - startIndex;  // safe: index >= startIndex at start and then increases\n    }\n\n    // SafeCast lib is missing cast to uint192    \n    function _toUint192(uint256 _value) internal pure returns (uint192) {\n        require(_value < 2**192, \"value doesn't fit in 192 bits\");\n        return uint192(_value);\n    }\n}\n"},{"file_path":"./contracts/token/lib/CheckPointHistoryCache.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"./CheckPointHistory.sol\";\n\n\nlibrary CheckPointHistoryCache {\n    using SafeMath for uint256;\n    using CheckPointHistory for CheckPointHistory.CheckPointHistoryState;\n    \n    struct CacheState {\n        // mapping blockNumber => (value + 1)\n        mapping(uint256 => uint256) cache;\n    }\n    \n    function valueAt(\n        CacheState storage _self,\n        CheckPointHistory.CheckPointHistoryState storage _checkPointHistory,\n        uint256 _blockNumber\n    )\n        internal returns (uint256 _value, bool _cacheCreated)\n    {\n        // is it in cache?\n        uint256 cachedValue = _self.cache[_blockNumber];\n        if (cachedValue != 0) {\n            return (cachedValue - 1, false);    // safe, cachedValue != 0\n        }\n        // read from _checkPointHistory\n        uint256 historyValue = _checkPointHistory.valueAt(_blockNumber);\n        _self.cache[_blockNumber] = historyValue.add(1);  // store to cache (add 1 to differentiate from empty)\n        return (historyValue, true);\n    }\n    \n    function deleteAt(\n        CacheState storage _self,\n        uint256 _blockNumber\n    )\n        internal returns (uint256 _deleted)\n    {\n        if (_self.cache[_blockNumber] != 0) {\n            _self.cache[_blockNumber] = 0;\n            return 1;\n        }\n        return 0;\n    }\n}\n"},{"file_path":"./contracts/userInterfaces/IGovernanceSettings.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity >=0.7.6 <0.9;\n\n\n/**\n * A special contract that holds Flare governance address.\n * This contract enables updating governance address and timelock only by hard forking the network,\n * meaning only by updating validator code.\n */\ninterface IGovernanceSettings {\n    /**\n     * Get the governance account address.\n     * The governance address can only be changed by a hardfork.\n     */\n    function getGovernanceAddress() external view returns (address);\n    \n    /**\n     * Get the time in seconds that must pass between a governance call and execution.\n     * The timelock value can only be changed by a hardfork.\n     */\n    function getTimelock() external view returns (uint256);\n    \n    /**\n     * Get the addresses of the accounts that are allowed to execute the timelocked governance calls\n     * once the timelock period expires.\n     * Executors can be changed without a hardfork, via a normal governance call.\n     */\n    function getExecutors() external view returns (address[] memory);\n    \n    /**\n     * Check whether an address is one of the executors.\n     */\n    function isExecutor(address _address) external view returns (bool);\n}\n"},{"file_path":"./contracts/utils/implementation/AddressSet.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\nlibrary AddressSet {\n    struct State {\n        address[] list;\n        mapping (address => uint256) index;\n    }\n    \n    function add(State storage _state, address _address) internal {\n        if (_state.index[_address] != 0) return;\n        _state.list.push(_address);\n        _state.index[_address] = _state.list.length;\n    }\n    \n    function remove(State storage _state, address _address) internal {\n        uint256 position = _state.index[_address];\n        if (position == 0) return;\n        if (position < _state.list.length) {\n            address addressToMove = _state.list[_state.list.length - 1];\n            _state.list[position - 1] = addressToMove;\n            _state.index[addressToMove] = position;\n        }\n        _state.list.pop();\n        delete _state.index[_address];\n    }\n    \n    function addAll(State storage _state, address[] memory _addresses) internal {\n        for (uint256 i = 0; i < _addresses.length; i++) {\n            add(_state, _addresses[i]);\n        }\n    }\n    \n    function replaceAll(State storage _state, address[] memory _addresses) internal {\n        clear(_state);\n        addAll(_state, _addresses);\n    }\n    \n    function clear(State storage _state) internal {\n        while (_state.list.length > 0) {\n            delete _state.index[_state.list[_state.list.length - 1]];\n            _state.list.pop();\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/math/Math.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a >= b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow, so we distribute\n        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/math/SafeMath.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.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 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        uint256 c = a + b;\n        if (c < a) return (false, 0);\n        return (true, c);\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        if (b > a) return (false, 0);\n        return (true, a - b);\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        // 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     * @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        if (b == 0) return (false, 0);\n        return (true, a / b);\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        if (b == 0) return (false, 0);\n        return (true, a % b);\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        uint256 c = a + b;\n        require(c >= a, \"SafeMath: addition overflow\");\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        require(b <= a, \"SafeMath: subtraction overflow\");\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        if (a == 0) return 0;\n        uint256 c = a * b;\n        require(c / a == b, \"SafeMath: multiplication overflow\");\n        return c;\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. 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        require(b > 0, \"SafeMath: division by zero\");\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        require(b > 0, \"SafeMath: modulo by zero\");\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(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b <= a, errorMessage);\n        return a - b;\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     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryDiv}.\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        return a / b;\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(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b > 0, errorMessage);\n        return a % b;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/SafeCast.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\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    /**\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 < 2**128, \"SafeCast: value doesn\\'t fit in 128 bits\");\n        return uint128(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 < 2**64, \"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 < 2**32, \"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 < 2**16, \"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 < 2**8, \"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 >= -2**127 && value < 2**127, \"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 >= -2**63 && value < 2**63, \"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 >= -2**31 && value < 2**31, \"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 >= -2**15 && value < 2**15, \"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 >= -2**7 && value < 2**7, \"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        require(value < 2**255, \"SafeCast: value doesn't fit in an int256\");\n        return int256(value);\n    }\n}\n"}],"certified":true,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"address","name":"_governance","type":"address"},{"internalType":"address","name":"_addressUpdater","type":"address"},{"internalType":"uint256","name":"_initialGenesisAmountWei","type":"uint256"},{"internalType":"uint256","name":"_totalExcludedSupplyWei","type":"uint256"},{"internalType":"contract IITokenPool[]","name":"_tokenPools","type":"address[]"},{"internalType":"address[]","name":"_foundationAddresses","type":"address[]"},{"internalType":"contract IISupply","name":"_oldSupply","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"actual","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expected","type":"uint256"}],"name":"AuthorizedInflationUpdateError","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"addedFoundationAddresses","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"removedFoundationAddresses","type":"address[]"}],"name":"FoundationAddressesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"uint256","name":"allowedAfterTimestamp","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"encodedCall","type":"bytes"}],"name":"GovernanceCallTimelocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"initialGovernance","type":"address"}],"name":"GovernanceInitialised","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"governanceSettings","type":"address"}],"name":"GovernedProductionModeEntered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"TimelockedGovernanceCallCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"TimelockedGovernanceCallExecuted","type":"event"},{"inputs":[{"internalType":"contract IITokenPool","name":"_tokenPool","type":"address"},{"internalType":"uint256","name":"_increaseDistributedSupplyByAmountWei","type":"uint256"}],"name":"addTokenPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burnAddress","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"burnAddressSongbirdTxFee","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"cancelGovernanceCall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_foundationAddressesToAdd","type":"address[]"},{"internalType":"address[]","name":"_foundationAddressesToRemove","type":"address[]"}],"name":"changeFoundationAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountWei","type":"uint256"}],"name":"decreaseDistributedSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distributedExcludedSupplyWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"executeGovernanceCall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAddressUpdater","outputs":[{"internalType":"address","name":"_addressUpdater","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_blockNumber","type":"uint256"}],"name":"getCirculatingSupplyAt","outputs":[{"internalType":"uint256","name":"_circulatingSupplyWei","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_blockNumber","type":"uint256"}],"name":"getCirculatingSupplyAtCached","outputs":[{"internalType":"uint256","name":"_circulatingSupplyWei","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getFoundationAddresses","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInflatableBalance","outputs":[{"internalType":"uint256","name":"_inflatableBalanceWei","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governance","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governanceSettings","outputs":[{"internalType":"contract IGovernanceSettings","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountWei","type":"uint256"}],"name":"increaseDistributedSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"inflation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialGenesisAmountWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_initialGovernance","type":"address"}],"name":"initialise","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oldSupply","outputs":[{"internalType":"contract IISupply","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"productionMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"switchOverBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"switchToProductionMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"name":"timelockedCalls","outputs":[{"internalType":"uint256","name":"allowedAfterTimestamp","type":"uint256"},{"internalType":"bytes","name":"encodedCall","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPools","outputs":[{"internalType":"contract IITokenPool","name":"tokenPool","type":"address"},{"internalType":"uint256","name":"totalLockedWei","type":"uint256"},{"internalType":"uint256","name":"totalInflationAuthorizedWei","type":"uint256"},{"internalType":"uint256","name":"totalClaimedWei","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalClaimedWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalExcludedSupplyWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalInflationAuthorizedWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLockedWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_inflationAuthorizedWei","type":"uint256"}],"name":"updateAuthorizedInflationAndCirculatingSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateCirculatingSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_contractNameHashes","type":"bytes32[]"},{"internalType":"address[]","name":"_contractAddresses","type":"address[]"}],"name":"updateContractAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":true,"constructor_args":"0x0000000000000000000000004598a6c05910ab914f0cbaaca1911cd337d10d290000000000000000000000004598a6c05910ab914f0cbaaca1911cd337d10d290000000000000000000000000000000000000001431e0fae6d7217caa00000000000000000000000000000000000000000000000dbb8481a7362102da000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000008577d2d50827bce2ec1dc9cf9f1199826781d5af00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}