creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/dao/DAO.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"openzeppelin-contracts/contracts/security/ReentrancyGuard.sol\";\nimport \"../rewards/interfaces/IRewardsEmitter.sol\";\nimport \"../rewards/interfaces/IRewardsConfig.sol\";\nimport \"../interfaces/IExchangeConfig.sol\";\nimport \"../staking/interfaces/IStaking.sol\";\nimport \"../interfaces/IAccessManager.sol\";\nimport \"./interfaces/ICalledContract.sol\";\nimport \"./interfaces/IProposals.sol\";\nimport \"./interfaces/IDAO.sol\";\nimport \"../pools/PoolUtils.sol\";\nimport \"./Parameters.sol\";\nimport \"../Upkeep.sol\";\n\n\n// Allows users to propose and vote on various governance actions such as changing parameters, whitelisting/unwhitelisting tokens, sending tokens, calling other contracts, and updating the website.\n// It handles proposing ballots, tracking votes, enforcing voting requirements, and executing approved proposals.\ncontract DAO is IDAO, Parameters, ReentrancyGuard\n    {\n\tevent ParameterBallotFinalized(uint256 indexed ballotID, Vote winningVote);\n    event SetAccessManager(address indexed contractAddress);\n    event SetWebsiteURL(string newURL);\n    event WhitelistToken(IERC20 indexed token);\n    event UnwhitelistToken(IERC20 indexed token);\n    event GeoExclusionUpdated(string country, bool excluded, uint256 geoVersion);\n    event TokensWithdrawn(address indexed upkeepContract, IERC20 indexed token, uint256 withdrawnAmount);\n    event SaltSent(address indexed to, uint256 amount);\n    event ContractCalled(address indexed contractAddress, uint256 indexed intArg);\n    event TeamRewardsTransferred(uint256 teamAmount);\n\n\tusing SafeERC20 for ISalt;\n\tusing SafeERC20 for IERC20;\n\n\tuint256 constant SEND_SALT_COOLDOWN = 1 weeks;\n\n\tIPools immutable public pools;\n\tIProposals immutable public proposals;\n\tIExchangeConfig immutable public exchangeConfig;\n\tIPoolsConfig immutable public poolsConfig;\n\tIStakingConfig immutable public stakingConfig;\n\tIRewardsConfig immutable public rewardsConfig;\n\tIDAOConfig immutable public daoConfig;\n\tIRewardsEmitter immutable public liquidityRewardsEmitter;\n\n\t// The default IPFS URL for the website content (can be changed with a setWebsiteURL proposal)\n\tstring public websiteURL;\n\n\t// Countries that have been excluded from access to the DEX (used by AccessManager.sol)\n\t// Keys as ISO 3166 Alpha-2 Codes\n\tmapping(string=>bool) public excludedCountries;\n\n\t// The last timestamp that SALT was sent from the DAO\n\tuint256 public nextValidTimestampSendSALT;\n\n\n    constructor( IPools _pools, IProposals _proposals, IExchangeConfig _exchangeConfig, IPoolsConfig _poolsConfig, IStakingConfig _stakingConfig, IRewardsConfig _rewardsConfig, IDAOConfig _daoConfig, IRewardsEmitter _liquidityRewardsEmitter )\n\t\t{\n\t\tpools = _pools;\n\t\tproposals = _proposals;\n\t\texchangeConfig = _exchangeConfig;\n\t\tpoolsConfig = _poolsConfig;\n\t\tstakingConfig = _stakingConfig;\n\t\trewardsConfig = _rewardsConfig;\n\t\tdaoConfig = _daoConfig;\n        liquidityRewardsEmitter = _liquidityRewardsEmitter;\n\n\t\t// Excluded by default: United States, Canada, United Kingdom, China, India, Pakistan, Russia, Afghanistan, Cuba, Iran, North Korea, Syria, Venezuela\n\t\t// Note that the DAO can remove any of these exclusions - or open up access completely to the exchange as it sees fit.\n\t\texcludedCountries[\"US\"] = true;\n\t\texcludedCountries[\"CA\"] = true;\n\t\texcludedCountries[\"GB\"] = true;\n\t\texcludedCountries[\"CN\"] = true;\n\t\texcludedCountries[\"IN\"] = true;\n\t\texcludedCountries[\"PK\"] = true;\n\t\texcludedCountries[\"RU\"] = true;\n\t\texcludedCountries[\"AF\"] = true;\n\t\texcludedCountries[\"CU\"] = true;\n\t\texcludedCountries[\"IR\"] = true;\n\t\texcludedCountries[\"KP\"] = true;\n\t\texcludedCountries[\"SY\"] = true;\n\t\texcludedCountries[\"VE\"] = true;\n        }\n\n\n\t// Finalize the vote for a parameter ballot (increase, decrease or no_change) for a given parameter\n\tfunction _finalizeParameterBallot( uint256 ballotID ) internal\n\t\t{\n\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\n\t\tVote winningVote = proposals.winningParameterVote(ballotID);\n\n\t\tif ( winningVote == Vote.INCREASE )\n\t\t\t_executeParameterChange( ParameterTypes(ballot.number1), true, poolsConfig, stakingConfig, rewardsConfig, daoConfig );\n\t\telse if ( winningVote == Vote.DECREASE )\n\t\t\t_executeParameterChange( ParameterTypes(ballot.number1), false, poolsConfig, stakingConfig, rewardsConfig, daoConfig );\n\n\t\temit ParameterBallotFinalized(ballotID, winningVote);\n\t\t}\n\n\n\tfunction _executeSetAccessManager( Ballot memory ballot ) internal\n\t\t{\n\t\texchangeConfig.setAccessManager( IAccessManager(ballot.address1) );\n\n\t\temit SetAccessManager(ballot.address1);\n\t\t}\n\n\n\tfunction _executeSetWebsiteURL( Ballot memory ballot ) internal\n\t\t{\n\t\twebsiteURL = ballot.string1;\n\t\temit SetWebsiteURL(ballot.string1);\n\t\t}\n\n\n\tfunction _executeApproval( Ballot memory ballot ) internal\n\t\t{\n\t\tif ( ballot.ballotType == BallotType.UNWHITELIST_TOKEN )\n\t\t\t{\n\t\t\t// All tokens are paired with both WETH and USDC so unwhitelist those pools\n\t\t\tpoolsConfig.unwhitelistPool(IERC20(ballot.address1), exchangeConfig.weth() );\n\t\t\tpoolsConfig.unwhitelistPool(IERC20(ballot.address1), exchangeConfig.usdc() );\n\n\t\t\t// Make sure that the cached arbitrage indicies in PoolStats are updated\n\t\t\tpools.updateArbitrageIndicies();\n\n\t\t\temit UnwhitelistToken(IERC20(ballot.address1));\n\t\t\t}\n\n\t\telse if ( ballot.ballotType == BallotType.SEND_SALT )\n\t\t\t{\n\t\t\t// Make sure the contract has the SALT balance before trying to send it.\n\t\t\t// This should not happen but is here just in case - to prevent approved proposals from reverting on finalization.\n\t\t\tif ( exchangeConfig.salt().balanceOf(address(this)) >= ballot.number1 )\n\t\t\t\t{\n\t\t\t\tIERC20(exchangeConfig.salt()).safeTransfer( ballot.address1, ballot.number1 );\n\n\t\t\t\tnextValidTimestampSendSALT = block.timestamp + SEND_SALT_COOLDOWN;\n\n\t\t\t\temit SaltSent(ballot.address1, ballot.number1);\n\t\t\t\t}\n\t\t\t}\n\n\t\telse if ( ballot.ballotType == BallotType.CALL_CONTRACT )\n\t\t\t{\n\t\t\ttry ICalledContract(ballot.address1).callFromDAO(ballot.number1)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\tcatch (bytes memory)\n\t\t\t\t{\n\t\t\t\t}\n\n\t\t\temit ContractCalled(ballot.address1, ballot.number1);\n \t\t\t}\n\n\t\telse if ( ballot.ballotType == BallotType.INCLUDE_COUNTRY )\n\t\t\t{\n\t\t\texcludedCountries[ ballot.string1 ] = false;\n\n\t\t\temit GeoExclusionUpdated(ballot.string1, false, exchangeConfig.accessManager().geoVersion());\n\t\t\t}\n\n\t\telse if ( ballot.ballotType == BallotType.EXCLUDE_COUNTRY )\n\t\t\t{\n\t\t\texcludedCountries[ ballot.string1 ] = true;\n\n\t\t\t// If the AccessManager doesn't implement excludedCountriesUpdated, this will revert and countries will not be able to be excluded until the AccessManager is working properly.\n\t\t\texchangeConfig.accessManager().excludedCountriesUpdated();\n\n\t\t\temit GeoExclusionUpdated(ballot.string1, true, exchangeConfig.accessManager().geoVersion());\n\t\t\t}\n\n\t\t// Once an initial setAccessManager proposal passes, it automatically starts a second confirmation ballot (to prevent last minute approvals)\n\t\telse if ( ballot.ballotType == BallotType.SET_ACCESS_MANAGER )\n\t\t\tproposals.createConfirmationProposal( string.concat(\"confirm_\", ballot.ballotName), BallotType.CONFIRM_SET_ACCESS_MANAGER, ballot.address1, \"\", ballot.description );\n\n\t\t// Once an initial setWebsiteURL proposal passes, it automatically starts a second confirmation ballot (to prevent last minute approvals)\n\t\telse if ( ballot.ballotType == BallotType.SET_WEBSITE_URL )\n\t\t\tproposals.createConfirmationProposal( string.concat(\"confirm_\", ballot.ballotName), BallotType.CONFIRM_SET_WEBSITE_URL, address(0), ballot.string1, ballot.description );\n\n\t\telse if ( ballot.ballotType == BallotType.CONFIRM_SET_ACCESS_MANAGER )\n\t\t\t_executeSetAccessManager( ballot );\n\n\t\telse if ( ballot.ballotType == BallotType.CONFIRM_SET_WEBSITE_URL )\n\t\t\t_executeSetWebsiteURL( ballot );\n\t\t}\n\n\n\t// Finalize the vote for an approval ballot (yes or no) for a given proposal\n\tfunction _finalizeApprovalBallot( uint256 ballotID ) internal\n\t\t{\n\t\tif ( proposals.ballotIsApproved(ballotID ) )\n\t\t\t{\n\t\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\t\t\t_executeApproval( ballot );\n\t\t\t}\n\t\t}\n\n\n\t// Finalize and execute a token whitelisting ballot.\n\t// If NO > YES than the proposal is removed immediately (quorum would already have been determined - in canFinalizeBallot as called from finalizeBallot).\n\tfunction _finalizeTokenWhitelisting( uint256 ballotID ) internal\n\t\t{\n\t\tif ( proposals.ballotIsApproved(ballotID ) )\n\t\t\t{\n\t\t\t// The ballot is approved. Any reversions below will allow the ballot to be attemped to be finalized later - as the ballot won't be finalized on reversion.\n\t\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\n\t\t\tuint256 bootstrappingRewards = daoConfig.bootstrappingRewards();\n\n\t\t\t// Make sure that the DAO contract holds the required amount of SALT for bootstrappingRewards.\n\t\t\t// Twice the bootstrapping rewards are needed (for both the token/WETH and token/USDC pools)\n\t\t\tuint256 saltBalance = exchangeConfig.salt().balanceOf( address(this) );\n\t\t\trequire( saltBalance >= bootstrappingRewards * 2, \"Whitelisting is not currently possible due to insufficient bootstrapping rewards\" );\n\n\t\t\t// All tokens are paired with both WETH and USDC, so whitelist both pairings\n\t\t\tpoolsConfig.whitelistPool( IERC20(ballot.address1), exchangeConfig.weth() );\n\t\t\tpoolsConfig.whitelistPool( IERC20(ballot.address1), exchangeConfig.usdc() );\n\n\t\t\t// Make sure that the cached arbitrage indicies in PoolStats are updated\n\t\t\tpools.updateArbitrageIndicies();\n\n\t\t\tbytes32 pool1 = PoolUtils._poolID( IERC20(ballot.address1), exchangeConfig.weth() );\n\t\t\tbytes32 pool2 = PoolUtils._poolID( IERC20(ballot.address1), exchangeConfig.usdc() );\n\n\t\t\t// Send the initial bootstrappingRewards to promote initial liquidity on these two newly whitelisted pools\n\t\t\tAddedReward[] memory addedRewards = new AddedReward[](2);\n\t\t\taddedRewards[0] = AddedReward( pool1, bootstrappingRewards );\n\t\t\taddedRewards[1] = AddedReward( pool2, bootstrappingRewards );\n\n\t\t\texchangeConfig.salt().approve( address(liquidityRewardsEmitter), bootstrappingRewards * 2 );\n\t\t\tliquidityRewardsEmitter.addSALTRewards( addedRewards );\n\n\t\t\temit WhitelistToken(IERC20(ballot.address1));\n\t\t\t}\n\t\t}\n\n\n\t// Finalize the vote on a specific ballot.\n\t// Can be called by anyone, but only actually finalizes the ballot if it can be finalized.\n\tfunction finalizeBallot( uint256 ballotID ) external nonReentrant\n\t\t{\n\t\t// Checks that ballot is live, and minimumEndTime and quorum have both been reached\n\t\trequire( proposals.canFinalizeBallot(ballotID), \"The ballot is not yet able to be finalized\" );\n\n\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\n\t\tif ( ballot.ballotType == BallotType.PARAMETER )\n\t\t\t_finalizeParameterBallot(ballotID);\n\t\telse if ( ballot.ballotType == BallotType.WHITELIST_TOKEN )\n\t\t\t_finalizeTokenWhitelisting(ballotID);\n\t\telse\n\t\t\t{\n\t\t\t// SALT can only be sent from the DAO once a week to combat DAO reserve draining attacks.\n\t\t\tif ( ballot.ballotType == BallotType.SEND_SALT )\n\t\t\tif ( block.timestamp < nextValidTimestampSendSALT )\n\t\t\t\treturn; // return and allow the Send SALT to be executed later\n\n\t\t\t_finalizeApprovalBallot(ballotID);\n\t\t\t}\n\n\t\t// Mark the ballot as no longer votable and remove it from the list of open ballots\n\t\tproposals.markBallotAsFinalized(ballotID);\n\t\t}\n\n\n\t// Remove a ballot from voting which has existed for longer than the DAOConfig.ballotMaximumDuration\n\tfunction manuallyRemoveBallot( uint256 ballotID ) external nonReentrant\n\t\t{\n\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\n\t\trequire( block.timestamp >= ballot.ballotMaximumEndTime, \"The ballot is not yet able to be manually removed\" );\n\n\t\t// Mark the ballot as no longer votable and remove it from the list of open ballots\n\t\tproposals.markBallotAsFinalized(ballotID);\n\t\t}\n\n\n\t// Withdraw deposited tokens in the Pools contract and send them to the caller (the Upkeep contract).\n\tfunction withdrawFromDAO( IERC20 token ) external returns (uint256 withdrawnAmount)\n\t\t{\n\t\trequire( msg.sender == address(exchangeConfig.upkeep()), \"DAO.withdrawFromDAO is only callable from the Upkeep contract\" );\n\n\t\twithdrawnAmount = pools.depositedUserBalance(address(this), token );\n\t\tif ( withdrawnAmount <= ( PoolUtils.DUST + 1 ) )\n\t\t\treturn 0;\n\n\t\t// Don't withdraw all profits to avoid the increased gas cost of overwriting zero\n\t\twithdrawnAmount -= 1;\n\n\t\tpools.withdraw( token, withdrawnAmount );\n\n\t\ttoken.safeTransfer( msg.sender, withdrawnAmount );\n\n\t\temit TokensWithdrawn(msg.sender, token, withdrawnAmount);\n\t\t}\n\n\n\t// === VIEWS ===\n\n\tfunction countryIsExcluded( string calldata country ) external view returns (bool)\n\t\t{\n\t\treturn excludedCountries[country];\n\t\t}\n\t}"
      },
      "lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot's contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler's defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction's gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant _NOT_ENTERED = 1;\n    uint256 private constant _ENTERED = 2;\n\n    uint256 private _status;\n\n    constructor() {\n        _status = _NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and making it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        _nonReentrantBefore();\n        _;\n        _nonReentrantAfter();\n    }\n\n    function _nonReentrantBefore() private {\n        // On the first call to nonReentrant, _status will be _NOT_ENTERED\n        require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n        // Any calls to nonReentrant after this point will fail\n        _status = _ENTERED;\n    }\n\n    function _nonReentrantAfter() private {\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        _status = _NOT_ENTERED;\n    }\n\n    /**\n     * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n     * `nonReentrant` function in the call stack.\n     */\n    function _reentrancyGuardEntered() internal view returns (bool) {\n        return _status == _ENTERED;\n    }\n}\n"
      },
      "src/rewards/interfaces/IRewardsEmitter.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"../../staking/interfaces/IStakingRewards.sol\";\n\n\ninterface IRewardsEmitter\n\t{\n\tfunction addSALTRewards( AddedReward[] calldata addedRewards ) external;\n\tfunction performUpkeep( uint256 timeSinceLastUpkeep ) external;\n\n\t// Views\n\tfunction pendingRewardsForPools( bytes32[] calldata pools ) external view returns (uint256[] calldata);\n\t}\n"
      },
      "src/rewards/interfaces/IRewardsConfig.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\n\ninterface IRewardsConfig\n\t{\n\tfunction changeRewardsEmitterDailyPercent(bool increase) external; // onlyOwner\n\tfunction changeEmissionsWeeklyPercent(bool increase) external; // onlyOwner\n\tfunction changeStakingRewardsPercent(bool increase) external; // onlyOwner\n\n\t// Views\n    function emissionsWeeklyPercentTimes1000() external view returns (uint256);\n    function rewardsEmitterDailyPercentTimes1000() external view returns (uint256);\n    function stakingRewardsPercent() external view returns (uint256);\n    }"
      },
      "src/interfaces/IExchangeConfig.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"openzeppelin-contracts/contracts/finance/VestingWallet.sol\";\nimport \"../staking/interfaces/ILiquidity.sol\";\nimport \"../launch/interfaces/IInitialDistribution.sol\";\nimport \"../rewards/interfaces/IRewardsEmitter.sol\";\nimport \"../rewards/interfaces/ISaltRewards.sol\";\nimport \"../rewards/interfaces/IEmissions.sol\";\nimport \"../interfaces/IAccessManager.sol\";\nimport \"../launch/interfaces/IAirdrop.sol\";\nimport \"../dao/interfaces/IDAO.sol\";\nimport \"../interfaces/ISalt.sol\";\nimport \"./IUpkeep.sol\";\n\n\ninterface IExchangeConfig\n\t{\n\tfunction setContracts( IDAO _dao, IUpkeep _upkeep, IInitialDistribution _initialDistribution, VestingWallet _teamVestingWallet, VestingWallet _daoVestingWallet ) external; // onlyOwner\n\tfunction setAccessManager( IAccessManager _accessManager ) external; // onlyOwner\n\n\t// Views\n\tfunction salt() external view returns (ISalt);\n\tfunction wbtc() external view returns (IERC20);\n\tfunction weth() external view returns (IERC20);\n\tfunction usdc() external view returns (IERC20);\n\tfunction usdt() external view returns (IERC20);\n\n\tfunction daoVestingWallet() external view returns (VestingWallet);\n    function teamVestingWallet() external view returns (VestingWallet);\n    function initialDistribution() external view returns (IInitialDistribution);\n\n\tfunction accessManager() external view returns (IAccessManager);\n\tfunction dao() external view returns (IDAO);\n\tfunction upkeep() external view returns (IUpkeep);\n\tfunction teamWallet() external view returns (address);\n\n\tfunction walletHasAccess( address wallet ) external view returns (bool);\n\t}\n"
      },
      "src/staking/interfaces/IStaking.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"./IStakingRewards.sol\";\n\n\n// Enum representing the possible states of an unstake request:\n// NONE: The default state, indicating that no unstake request has been made.\n// PENDING: The state indicating that an unstake request has been made, but has not yet completed.\n// CANCELLED: The state indicating that a pending unstake request has been cancelled by the user.\n// CLAIMED: The state indicating that a pending unstake request has been completed and the user can claim their SALT tokens.\nenum UnstakeState { NONE, PENDING, CANCELLED, CLAIMED }\n\n struct Unstake\n\t{\n\tUnstakeState status;\t\t\t// see above\n\n\taddress wallet;\t\t\t\t\t// the wallet of the user performing the unstake\n\tuint256 unstakedXSALT;\t\t// the amount of xSALT that was unstaked\n\tuint256 claimableSALT;\t\t// claimable SALT at completion time\n\tuint256 completionTime;\t// the timestamp when the unstake completes\n\tuint256\tunstakeID;\t\t\t// the unstake ID\n\t}\n\n\ninterface IStaking is IStakingRewards\n\t{\n\tfunction stakeSALT( uint256 amountToStake ) external;\n\tfunction unstake( uint256 amountUnstaked, uint256 numWeeks ) external returns (uint256 unstakeID);\n\tfunction cancelUnstake( uint256 unstakeID ) external;\n\tfunction recoverSALT( uint256 unstakeID ) external;\n\n\t// Views\n\tfunction userXSalt( address wallet ) external view returns (uint256);\n\tfunction unstakesForUser( address wallet, uint256 start, uint256 end ) external view returns (Unstake[] calldata);\n\tfunction unstakesForUser( address wallet ) external view returns (Unstake[] calldata);\n\tfunction userUnstakeIDs( address user ) external view returns (uint256[] calldata);\n\tfunction unstakeByID(uint256 id) external view returns (Unstake calldata);\n\tfunction calculateUnstake( uint256 unstakedXSALT, uint256 numWeeks ) external view returns (uint256);\n\t}\n"
      },
      "src/interfaces/IAccessManager.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\n\ninterface IAccessManager\n\t{\n\tfunction excludedCountriesUpdated() external;\n\tfunction grantAccess(bytes calldata signature) external;\n\n\t// Views\n\tfunction geoVersion() external view returns (uint256);\n\tfunction walletHasAccess(address wallet) external view returns (bool);\n\t}\n"
      },
      "src/dao/interfaces/ICalledContract.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\n\ninterface ICalledContract\n\t{\n    function callFromDAO(uint256) external;\n\t}"
      },
      "src/dao/interfaces/IProposals.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\";\n\n\nenum Vote { INCREASE, DECREASE, NO_CHANGE, YES, NO }\nenum BallotType { PARAMETER, WHITELIST_TOKEN, UNWHITELIST_TOKEN, SEND_SALT, CALL_CONTRACT, INCLUDE_COUNTRY, EXCLUDE_COUNTRY, SET_ACCESS_MANAGER, SET_WEBSITE_URL, CONFIRM_SET_ACCESS_MANAGER, CONFIRM_SET_WEBSITE_URL }\n\nstruct UserVote\n\t{\n\tVote vote;\n\tuint256 votingPower;\t\t\t\t// Voting power at the time the vote was cast\n\t}\n\nstruct Ballot\n\t{\n\tuint256 ballotID;\n\tbool ballotIsLive;\n\n\tBallotType ballotType;\n\tstring ballotName;\n\taddress address1;\n\tuint256 number1;\n\tstring string1;\n\tstring description;\n\n\t// The earliest timestamp at which a ballot can end. Can be open longer if the quorum has not yet been reached for instance.\n\tuint256 ballotMinimumEndTime;\n\n\t// The time at which any user can end the ballot - even if it hasn't been successfully finalized.\n\tuint256 ballotMaximumEndTime;\n\n\t// The requiredQuorum for the ballot\n\tuint256 requiredQuorum;\n\t}\n\n\ninterface IProposals\n\t{\n\tfunction createConfirmationProposal( string calldata ballotName, BallotType ballotType, address address1, string calldata string1, string calldata description ) external returns (uint256 ballotID);\n\tfunction markBallotAsFinalized( uint256 ballotID ) external;\n\n\tfunction proposeParameterBallot( uint256 parameterType, string calldata description ) external returns (uint256 ballotID);\n\tfunction proposeTokenWhitelisting( IERC20 token, string calldata tokenIconURL, string calldata description ) external returns (uint256 ballotID);\n\tfunction proposeTokenUnwhitelisting( IERC20 token, string calldata tokenIconURL, string calldata description ) external returns (uint256 ballotID);\n\tfunction proposeSendSALT( address wallet, uint256 amount, string calldata description ) external returns (uint256 ballotID);\n\tfunction proposeCallContract( address contractAddress, uint256 number, string calldata description ) external returns (uint256 ballotID);\n\tfunction proposeCountryInclusion( string calldata country, string calldata description ) external returns (uint256 ballotID);\n\tfunction proposeCountryExclusion( string calldata country, string calldata description ) external returns (uint256 ballotID);\n\tfunction proposeSetAccessManager( address newAddress, string calldata description ) external returns (uint256 ballotID);\n\tfunction proposeWebsiteUpdate( string calldata newWebsiteURL, string calldata description ) external returns (uint256 ballotID);\n\n\tfunction castVote( uint256 ballotID, Vote vote ) external;\n\n\t// Views\n\tfunction nextBallotID() external view returns (uint256);\n\tfunction openBallotsByName( string calldata name ) external view returns (uint256);\n\n\tfunction ballotForID( uint256 ballotID ) external view returns (Ballot calldata);\n\tfunction lastUserVoteForBallot( uint256 ballotID, address user ) external view returns (UserVote calldata);\n\tfunction votesCastForBallot( uint256 ballotID, Vote vote ) external view returns (uint256);\n\tfunction requiredQuorumForBallotType( BallotType ballotType ) external view returns (uint256 requiredQuorum);\n\tfunction totalVotesCastForBallot( uint256 ballotID ) external view returns (uint256);\n\tfunction ballotIsApproved( uint256 ballotID ) external view returns (bool);\n\tfunction winningParameterVote( uint256 ballotID ) external view returns (Vote);\n\tfunction canFinalizeBallot( uint256 ballotID ) external view returns (bool);\n\tfunction openBallots() external view returns (uint256[] memory);\n\tfunction openBallotsForTokenWhitelisting() external view returns (uint256[] memory);\n\tfunction userHasActiveProposal( address user ) external view returns (bool);\n\t}"
      },
      "src/dao/interfaces/IDAO.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"../../rewards/interfaces/ISaltRewards.sol\";\nimport \"../../pools/interfaces/IPools.sol\";\nimport \"../../interfaces/ISalt.sol\";\n\ninterface IDAO\n\t{\n\tfunction finalizeBallot( uint256 ballotID ) external;\n\tfunction manuallyRemoveBallot( uint256 ballotID ) external;\n\n\tfunction withdrawFromDAO( IERC20 token ) external returns (uint256 withdrawnAmount);\n\n\t// Views\n\tfunction pools() external view returns (IPools);\n\tfunction websiteURL() external view returns (string memory);\n\tfunction countryIsExcluded( string calldata country ) external view returns (bool);\n\t}"
      },
      "src/pools/PoolUtils.sol": {
        "content": "pragma solidity =0.8.22;\n\nimport \"openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\";\n\n\nlibrary PoolUtils\n\t{\n\t// Token reserves less than dust are treated as if they don't exist at all.\n\t// With the 18 decimals that are used for most tokens, DUST has a value of 0.0000000000000001\n\tuint256 constant public DUST = 100;\n\n\t// A special pool that represents staked SALT that is not associated with any actual liquidity pool.\n    bytes32 constant public STAKED_SALT = bytes32(0);\n\n\n    // Return the unique poolID for the given two tokens.\n    // Tokens are sorted before being hashed to make reversed pairs equivalent.\n    function _poolID( IERC20 tokenA, IERC20 tokenB ) internal pure returns (bytes32 poolID)\n    \t{\n        // See if the token orders are flipped\n        if ( uint160(address(tokenB)) < uint160(address(tokenA)) )\n            return keccak256(abi.encodePacked(address(tokenB), address(tokenA)));\n\n        return keccak256(abi.encodePacked(address(tokenA), address(tokenB)));\n    \t}\n\n\n    // Return the unique poolID and whether or not it is flipped\n    function _poolIDAndFlipped( IERC20 tokenA, IERC20 tokenB ) internal pure returns (bytes32 poolID, bool flipped)\n    \t{\n        // See if the token orders are flipped\n        if ( uint160(address(tokenB)) < uint160(address(tokenA)) )\n            return (keccak256(abi.encodePacked(address(tokenB), address(tokenA))), true);\n\n        return (keccak256(abi.encodePacked(address(tokenA), address(tokenB))), false);\n    \t}\n\t}\n"
      },
      "src/dao/Parameters.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"../rewards/interfaces/IRewardsConfig.sol\";\nimport \"../staking/interfaces/IStakingConfig.sol\";\nimport \"../pools/interfaces/IPoolsConfig.sol\";\nimport \"./interfaces/IDAOConfig.sol\";\n\n\nabstract contract Parameters\n    {\n\tenum ParameterTypes {\n\n\t\t// PoolsConfig\n\t\tmaximumWhitelistedPools,\n\n\t\t// StakingConfig\n\t\tminUnstakeWeeks,\n\t\tmaxUnstakeWeeks,\n\t\tminUnstakePercent,\n\t\tmodificationCooldown,\n\n\t\t// RewardsConfig\n    \trewardsEmitterDailyPercentTimes1000,\n\t\temissionsWeeklyPercentTimes1000,\n\t\tstakingRewardsPercent,\n\n\t\t// DAOConfig\n\t\tbootstrappingRewards,\n\t\tpercentRewardsBurned,\n\t\tbaseBallotQuorumPercentTimes1000,\n\t\tballotDuration,\n\t\trequiredProposalPercentStakeTimes1000,\n\t\tpercentRewardsForReserve,\n\t\tupkeepRewardPercent,\n\t\tballotMaximumDuration\n\t\t}\n\n\n\t// If the parameter has an invalid parameterType then the call is a no-op\n\tfunction _executeParameterChange( ParameterTypes parameterType, bool increase, IPoolsConfig poolsConfig, IStakingConfig stakingConfig, IRewardsConfig rewardsConfig, IDAOConfig daoConfig ) internal\n\t\t{\n\t\t// PoolsConfig\n\t\tif ( parameterType == ParameterTypes.maximumWhitelistedPools )\n\t\t\tpoolsConfig.changeMaximumWhitelistedPools( increase );\n\n\t\t// StakingConfig\n\t\telse if ( parameterType == ParameterTypes.minUnstakeWeeks )\n\t\t\tstakingConfig.changeMinUnstakeWeeks(increase);\n\t\telse if ( parameterType == ParameterTypes.maxUnstakeWeeks )\n\t\t\tstakingConfig.changeMaxUnstakeWeeks(increase);\n\t\telse if ( parameterType == ParameterTypes.minUnstakePercent )\n\t\t\tstakingConfig.changeMinUnstakePercent(increase);\n\t\telse if ( parameterType == ParameterTypes.modificationCooldown )\n\t\t\tstakingConfig.changeModificationCooldown(increase);\n\n\t\t// RewardsConfig\n\t\telse if ( parameterType == ParameterTypes.rewardsEmitterDailyPercentTimes1000 )\n\t\t\trewardsConfig.changeRewardsEmitterDailyPercent(increase);\n\t\telse if ( parameterType == ParameterTypes.emissionsWeeklyPercentTimes1000 )\n\t\t\trewardsConfig.changeEmissionsWeeklyPercent(increase);\n\t\telse if ( parameterType == ParameterTypes.stakingRewardsPercent )\n\t\t\trewardsConfig.changeStakingRewardsPercent(increase);\n\n\t\t// DAOConfig\n\t\telse if ( parameterType == ParameterTypes.bootstrappingRewards )\n\t\t\tdaoConfig.changeBootstrappingRewards(increase);\n\t\telse if ( parameterType == ParameterTypes.percentRewardsBurned )\n\t\t\tdaoConfig.changePercentRewardsBurned(increase);\n\t\telse if ( parameterType == ParameterTypes.baseBallotQuorumPercentTimes1000 )\n\t\t\tdaoConfig.changeBaseBallotQuorumPercent(increase);\n\t\telse if ( parameterType == ParameterTypes.ballotDuration )\n\t\t\tdaoConfig.changeBallotDuration(increase);\n\t\telse if ( parameterType == ParameterTypes.requiredProposalPercentStakeTimes1000 )\n\t\t\tdaoConfig.changeRequiredProposalPercentStake(increase);\n\t\telse if ( parameterType == ParameterTypes.percentRewardsForReserve )\n\t\t\tdaoConfig.changePercentRewardsForReserve(increase);\n\t\telse if ( parameterType == ParameterTypes.upkeepRewardPercent )\n\t\t\tdaoConfig.changeUpkeepRewardPercent(increase);\n\t\telse if ( parameterType == ParameterTypes.ballotMaximumDuration )\n\t\t\tdaoConfig.changeBallotMaximumDuration(increase);\n\t\t}\n\t}"
      },
      "src/Upkeep.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"openzeppelin-contracts/contracts/security/ReentrancyGuard.sol\";\nimport \"openzeppelin-contracts/contracts/finance/VestingWallet.sol\";\nimport \"./rewards/interfaces/IEmissions.sol\";\nimport \"./pools/interfaces/IPoolsConfig.sol\";\nimport \"./interfaces/IExchangeConfig.sol\";\nimport \"./dao/interfaces/IDAOConfig.sol\";\nimport \"./pools/interfaces/IPools.sol\";\nimport \"./dao/interfaces/IDAO.sol\";\n\n\n// Performs the following upkeep for each call to performUpkeep():\n// (Uses a maximum of 1.1 million gas with 100 whitelisted pools according to UpkeepGasUsage.t.sol)\n\n// 1. Withdraws deposited SALT arbitrage profits from the Pools contract and rewards the caller of performUpkeep() with 5% of the withdrawn SALT\n// 2. Burns 10% of the remaining withdrawn salt and sends 10% to the DAO's reserve.\n// 3. Sends the remaining SALT to SaltRewards.\n\n// 4. Sends SALT Emissions to the SaltRewards contract.\n// 5. Distributes SALT from SaltRewards to the stakingRewardsEmitter and liquidityRewardsEmitter.\n// 6. Distributes SALT rewards from the stakingRewardsEmitter and liquidityRewardsEmitter.\n\n// 7. Sends SALT from the DAO vesting wallet to the DAO (linear distribution over 10 years).\n// 8. Sends SALT from the team vesting wallet to the team (linear distribution over 10 years).\n\ncontract Upkeep is IUpkeep, ReentrancyGuard\n    {\n\tusing SafeERC20 for ISalt;\n\tusing SafeERC20 for IERC20;\n\n    event UpkeepError(string description, bytes error);\n\n\tIPools immutable public pools;\n\tIExchangeConfig  immutable public exchangeConfig;\n\tIPoolsConfig immutable public poolsConfig;\n\tIDAOConfig immutable public daoConfig;\n\tISaltRewards immutable public saltRewards;\n\tIEmissions immutable public emissions;\n\tIDAO immutable public dao;\n\n\tISalt  immutable public salt;\n\n\tuint256 public lastUpkeepTimeEmissions;\n\tuint256 public lastUpkeepTimeRewardsEmitters;\n\n\n    constructor( IPools _pools, IExchangeConfig _exchangeConfig, IPoolsConfig _poolsConfig, IDAOConfig _daoConfig, ISaltRewards _saltRewards, IEmissions _emissions, IDAO _dao )\n\t\t{\n\t\tpools = _pools;\n\t\texchangeConfig = _exchangeConfig;\n\t\tpoolsConfig = _poolsConfig;\n\t\tdaoConfig = _daoConfig;\n\t\tsaltRewards = _saltRewards;\n\t\temissions = _emissions;\n\t\tdao = _dao;\n\n\t\t// Cached for efficiency\n\t\tsalt = _exchangeConfig.salt();\n\n\t\tlastUpkeepTimeEmissions = block.timestamp;\n\t\tlastUpkeepTimeRewardsEmitters = block.timestamp;\n\t\t}\n\n\n\tmodifier onlySameContract()\n\t\t{\n    \trequire(msg.sender == address(this), \"Only callable from within the same contract\");\n    \t_;\n\t\t}\n\n\n\t// Note - while the following steps are public so that they can be wrapped in a try/catch, they are all still only callable from this same contract.\n\n\t// 1. Withdraw deposited SALT arbitrage profits from the Pools contract and reward the caller of performUpkeep() with 5% of the withdrawn SALT\n\tfunction step1(address receiver) public onlySameContract\n\t\t{\n\t\tuint256 withdrawnSALT = dao.withdrawFromDAO(salt);\n\t\tif ( withdrawnSALT == 0 )\n\t\t\treturn;\n\n\t\t// Default 5% of the original SALT arbitrage profits should be rewarded to the caller of performUpkeep.\n\t\tuint256 rewardAmount = withdrawnSALT * daoConfig.upkeepRewardPercent() / 100;\n\n\t\t// Send the reward\n\t\tsalt.safeTransfer(receiver, rewardAmount);\n\t\t}\n\n\n\t// 2. Burn 10% of the remaining withdrawn salt and send 10% to the DAO's reserve.\n\tfunction step2() public onlySameContract\n\t\t{\n\t\tuint256 saltBalance = salt.balanceOf( address(this) );\n\t\tif ( saltBalance == 0 )\n\t\t\treturn;\n\n\t\t// Default 10% of the remaining SALT profits should be burned\n\t\tuint256 burnAmount = saltBalance * daoConfig.percentRewardsBurned() / 100;\n\t\tsalt.transfer( address(salt), burnAmount);\n\t\tsalt.burnTokensInContract();\n\n\t\t// Default 10% of the remaining SALT profits should be sent to the DAO's reserve\n\t\tuint256 reserveAmount = saltBalance * daoConfig.percentRewardsForReserve() / 100;\n\t\tsalt.transfer( address(dao), reserveAmount);\n\t\t}\n\n\n\t// 3. Send the remaining SALT to SaltRewards\n\tfunction step3() public onlySameContract\n\t\t{\n\t\tuint256 saltBalance = salt.balanceOf( address(this) );\n\t\tif ( saltBalance == 0 )\n\t\t\treturn;\n\n\t\tsalt.safeTransfer(address(saltRewards), saltBalance);\n\t\t}\n\n\n\t// 4. Send SALT Emissions to the SaltRewards contract.\n\tfunction step4() public onlySameContract\n\t\t{\n\t\tuint256 timeSinceLastUpkeep = block.timestamp - lastUpkeepTimeEmissions;\n\t\temissions.performUpkeep(timeSinceLastUpkeep);\n\n\t\tlastUpkeepTimeEmissions = block.timestamp;\n\t\t}\n\n\n\t// 5. Distribute SALT from SaltRewards to the stakingRewardsEmitter and liquidityRewardsEmitter.\n\tfunction step5() public onlySameContract\n\t\t{\n\t\tuint256[] memory profitsForPools = pools.profitsForWhitelistedPools();\n\t\tbytes32[] memory poolIDs = poolsConfig.whitelistedPools();\n\n\t\tsaltRewards.performUpkeep(poolIDs, profitsForPools );\n\t\tpools.clearProfitsForPools();\n\t\t}\n\n\n\t// 6. Distribute SALT rewards from the stakingRewardsEmitter and liquidityRewardsEmitter.\n\tfunction step6() public onlySameContract\n\t\t{\n\t\tuint256 timeSinceLastUpkeep = block.timestamp - lastUpkeepTimeRewardsEmitters;\n\n\t\tsaltRewards.stakingRewardsEmitter().performUpkeep(timeSinceLastUpkeep);\n\t\tsaltRewards.liquidityRewardsEmitter().performUpkeep(timeSinceLastUpkeep);\n\n\t\tlastUpkeepTimeRewardsEmitters = block.timestamp;\n\t\t}\n\n\n\t// 7. Send SALT from the DAO vesting wallet to the DAO (linear distribution over 10 years).\n\tfunction step7() public onlySameContract\n\t\t{\n\t\texchangeConfig.daoVestingWallet().release(address(salt));\n\t\t}\n\n\n\t// 8. Sends SALT from the team vesting wallet to the team (linear distribution over 10 years).\n\tfunction step8() public onlySameContract\n\t\t{\n\t\texchangeConfig.teamVestingWallet().release(address(salt));\n\t\t}\n\n\n\t// Perform the various steps of performUpkeep as outlined at the top of the contract.\n\t// Each step is wrapped in a try/catch to prevent reversions from cascading through the performUpkeep.\n\tfunction performUpkeep() public nonReentrant\n\t\t{\n\t\trequire(lastUpkeepTimeEmissions != block.timestamp, \"No time since elapsed since last upkeep\");\n\n\t\t// Perform the multiple steps of performUpkeep()\n \t\ttry this.step1(msg.sender) {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 1\", error); }\n\n \t\ttry this.step2() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 2\", error); }\n\n \t\ttry this.step3() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 3\", error); }\n\n \t\ttry this.step4() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 4\", error); }\n\n \t\ttry this.step5() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 5\", error); }\n\n \t\ttry this.step6() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 6\", error); }\n\n \t\ttry this.step7() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 7\", error); }\n\n \t\ttry this.step8() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 8\", error); }\n\t\t}\n\n\n\t// ==== VIEWS ====\n\t// Returns the amount of WETH that will currently be rewarded for calling performUpkeep().\n\t// Useful for potential callers to know if calling the function will be profitable in comparison to current gas costs.\n\tfunction currentRewardsForCallingPerformUpkeep() public view returns (uint256)\n\t\t{\n\t\tuint256 depositedSALT = pools.depositedUserBalance(address(dao), salt);\n\n\t\t// Default 5% of the original SALT arbitrage profits should be rewarded to the caller of performUpkeep.\n\t\treturn depositedSALT * daoConfig.upkeepRewardPercent() / 100;\n\t\t}\n\t}\n"
      },
      "src/staking/interfaces/IStakingRewards.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\n\nstruct AddedReward\n\t{\n\tbytes32 poolID;\t\t\t\t\t\t\t// The pool to add rewards to\n\tuint256 amountToAdd;\t\t\t\t// The amount of rewards (as SALT) to add\n\t}\n\nstruct UserShareInfo\n\t{\n\tuint256 userShare;\t\t\t\t\t// A user's share for a given poolID\n\tuint256 virtualRewards;\t\t\t\t// The amount of rewards that were added to maintain proper rewards/share ratio - and will be deducted from a user's pending rewards.\n\tuint256 cooldownExpiration;\t\t// The timestamp when the user can modify their share\n\t}\n\n\ninterface IStakingRewards\n\t{\n\tfunction claimAllRewards( bytes32[] calldata poolIDs ) external returns (uint256 rewardsAmount);\n\tfunction addSALTRewards( AddedReward[] calldata addedRewards ) external;\n\n\t// Views\n\tfunction totalShares(bytes32 poolID) external view returns (uint256);\n\tfunction totalSharesForPools( bytes32[] calldata poolIDs ) external view returns (uint256[] calldata shares);\n\tfunction totalRewardsForPools( bytes32[] calldata poolIDs ) external view returns (uint256[] calldata rewards);\n\n\tfunction userRewardForPool( address wallet, bytes32 poolID ) external view returns (uint256);\n\tfunction userShareForPool( address wallet, bytes32 poolID ) external view returns (uint256);\n\tfunction userVirtualRewardsForPool( address wallet, bytes32 poolID ) external view returns (uint256);\n\n\tfunction userRewardsForPools( address wallet, bytes32[] calldata poolIDs ) external view returns (uint256[] calldata rewards);\n\tfunction userShareForPools( address wallet, bytes32[] calldata poolIDs ) external view returns (uint256[] calldata shares);\n\tfunction userCooldowns( address wallet, bytes32[] calldata poolIDs ) external view returns (uint256[] calldata cooldowns);\n\t}\n"
      },
      "lib/openzeppelin-contracts/contracts/finance/VestingWallet.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (finance/VestingWallet.sol)\npragma solidity ^0.8.0;\n\nimport \"../token/ERC20/utils/SafeERC20.sol\";\nimport \"../utils/Address.sol\";\nimport \"../utils/Context.sol\";\n\n/**\n * @title VestingWallet\n * @dev This contract handles the vesting of Eth and ERC20 tokens for a given beneficiary. Custody of multiple tokens\n * can be given to this contract, which will release the token to the beneficiary following a given vesting schedule.\n * The vesting schedule is customizable through the {vestedAmount} function.\n *\n * Any token transferred to this contract will follow the vesting schedule as if they were locked from the beginning.\n * Consequently, if the vesting has already started, any amount of tokens sent to this contract will (at least partly)\n * be immediately releasable.\n */\ncontract VestingWallet is Context {\n    event EtherReleased(uint256 amount);\n    event ERC20Released(address indexed token, uint256 amount);\n\n    uint256 private _released;\n    mapping(address => uint256) private _erc20Released;\n    address private immutable _beneficiary;\n    uint64 private immutable _start;\n    uint64 private immutable _duration;\n\n    /**\n     * @dev Set the beneficiary, start timestamp and vesting duration of the vesting wallet.\n     */\n    constructor(address beneficiaryAddress, uint64 startTimestamp, uint64 durationSeconds) payable {\n        require(beneficiaryAddress != address(0), \"VestingWallet: beneficiary is zero address\");\n        _beneficiary = beneficiaryAddress;\n        _start = startTimestamp;\n        _duration = durationSeconds;\n    }\n\n    /**\n     * @dev The contract should be able to receive Eth.\n     */\n    receive() external payable virtual {}\n\n    /**\n     * @dev Getter for the beneficiary address.\n     */\n    function beneficiary() public view virtual returns (address) {\n        return _beneficiary;\n    }\n\n    /**\n     * @dev Getter for the start timestamp.\n     */\n    function start() public view virtual returns (uint256) {\n        return _start;\n    }\n\n    /**\n     * @dev Getter for the vesting duration.\n     */\n    function duration() public view virtual returns (uint256) {\n        return _duration;\n    }\n\n    /**\n     * @dev Amount of eth already released\n     */\n    function released() public view virtual returns (uint256) {\n        return _released;\n    }\n\n    /**\n     * @dev Amount of token already released\n     */\n    function released(address token) public view virtual returns (uint256) {\n        return _erc20Released[token];\n    }\n\n    /**\n     * @dev Getter for the amount of releasable eth.\n     */\n    function releasable() public view virtual returns (uint256) {\n        return vestedAmount(uint64(block.timestamp)) - released();\n    }\n\n    /**\n     * @dev Getter for the amount of releasable `token` tokens. `token` should be the address of an\n     * IERC20 contract.\n     */\n    function releasable(address token) public view virtual returns (uint256) {\n        return vestedAmount(token, uint64(block.timestamp)) - released(token);\n    }\n\n    /**\n     * @dev Release the native token (ether) that have already vested.\n     *\n     * Emits a {EtherReleased} event.\n     */\n    function release() public virtual {\n        uint256 amount = releasable();\n        _released += amount;\n        emit EtherReleased(amount);\n        Address.sendValue(payable(beneficiary()), amount);\n    }\n\n    /**\n     * @dev Release the tokens that have already vested.\n     *\n     * Emits a {ERC20Released} event.\n     */\n    function release(address token) public virtual {\n        uint256 amount = releasable(token);\n        _erc20Released[token] += amount;\n        emit ERC20Released(token, amount);\n        SafeERC20.safeTransfer(IERC20(token), beneficiary(), amount);\n    }\n\n    /**\n     * @dev Calculates the amount of ether that has already vested. Default implementation is a linear vesting curve.\n     */\n    function vestedAmount(uint64 timestamp) public view virtual returns (uint256) {\n        return _vestingSchedule(address(this).balance + released(), timestamp);\n    }\n\n    /**\n     * @dev Calculates the amount of tokens that has already vested. Default implementation is a linear vesting curve.\n     */\n    function vestedAmount(address token, uint64 timestamp) public view virtual returns (uint256) {\n        return _vestingSchedule(IERC20(token).balanceOf(address(this)) + released(token), timestamp);\n    }\n\n    /**\n     * @dev Virtual implementation of the vesting formula. This returns the amount vested, as a function of time, for\n     * an asset given its total historical allocation.\n     */\n    function _vestingSchedule(uint256 totalAllocation, uint64 timestamp) internal view virtual returns (uint256) {\n        if (timestamp < start()) {\n            return 0;\n        } else if (timestamp > start() + duration()) {\n            return totalAllocation;\n        } else {\n            return (totalAllocation * (timestamp - start())) / duration();\n        }\n    }\n}\n"
      },
      "src/staking/interfaces/ILiquidity.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\";\nimport \"./IStakingRewards.sol\";\n\n\ninterface ILiquidity is IStakingRewards\n\t{\n\tfunction depositLiquidityAndIncreaseShare( IERC20 tokenA, IERC20 tokenB, uint256 maxAmountA, uint256 maxAmountB, uint256 minAddedAmountA, uint256 minAddedAmountB, uint256 minAddedLiquidity, uint256 deadline, bool useZapping ) external returns (uint256 addedLiquidity);\n\tfunction withdrawLiquidityAndClaim( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToWithdraw, uint256 minReclaimedA, uint256 minReclaimedB, uint256 deadline ) external returns (uint256 reclaimedA, uint256 reclaimedB);\n\t}\n"
      },
      "src/launch/interfaces/IInitialDistribution.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"./IBootstrapBallot.sol\";\nimport \"./IAirdrop.sol\";\n\n\ninterface IInitialDistribution\n\t{\n\tfunction distributionApproved( IAirdrop airdrop1, IAirdrop airdrop2 ) external;\n\n\t// Views\n\tfunction bootstrapBallot() external view returns (IBootstrapBallot);\n\t}\n"
      },
      "src/rewards/interfaces/ISaltRewards.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"./IRewardsEmitter.sol\";\n\n\ninterface ISaltRewards\n\t{\n\tfunction sendInitialSaltRewards( uint256 liquidityBootstrapAmount, bytes32[] calldata poolIDs ) external;\n    function performUpkeep( bytes32[] calldata poolIDs, uint256[] calldata profitsForPools ) external;\n\n    // Views\n    function stakingRewardsEmitter() external view returns (IRewardsEmitter);\n    function liquidityRewardsEmitter() external view returns (IRewardsEmitter);\n    }"
      },
      "src/rewards/interfaces/IEmissions.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\n\ninterface IEmissions\n\t{\n\tfunction performUpkeep( uint256 timeSinceLastUpkeep ) external;\n    }"
      },
      "src/launch/interfaces/IAirdrop.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\n\ninterface IAirdrop\n\t{\n\tfunction authorizeWallet( address wallet, uint256 saltAmount ) external;\n\tfunction allowClaiming() external;\n\tfunction claim() external;\n\n\t// Views\n\tfunction claimedByUser( address wallet) external view returns (uint256);\n\tfunction claimingAllowed() external view returns (bool);\n\tfunction claimingStartTimestamp() external view returns (uint256);\n\tfunction claimableAmount(address wallet) external view returns (uint256);\n    function airdropForUser( address wallet ) external view returns (uint256);\n\t}\n"
      },
      "src/interfaces/ISalt.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\";\n\n\ninterface ISalt is IERC20\n\t{\n\tfunction burnTokensInContract() external;\n\n\t// Views\n\tfunction totalBurned() external view returns (uint256);\n\t}\n"
      },
      "src/interfaces/IUpkeep.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\n\ninterface IUpkeep\n\t{\n\tfunction performUpkeep() external;\n\n\t// Views\n\tfunction currentRewardsForCallingPerformUpkeep() external view returns (uint256);\n\tfunction lastUpkeepTimeEmissions() external view returns (uint256);\n\tfunction lastUpkeepTimeRewardsEmitters() external view returns (uint256);\n\t}\n"
      },
      "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
      },
      "src/pools/interfaces/IPools.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"../../staking/interfaces/ILiquidity.sol\";\nimport \"../../dao/interfaces/IDAO.sol\";\nimport \"./IPoolStats.sol\";\n\n\ninterface IPools is IPoolStats\n\t{\n\tfunction startExchangeApproved() external;\n\tfunction setContracts( IDAO _dao, ILiquidity _liquidity ) external; // onlyOwner\n\n\tfunction addLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 maxAmountA, uint256 maxAmountB, uint256 minAddedAmountA, uint256 minAddedAmountB, uint256 totalLiquidity ) external returns (uint256 addedAmountA, uint256 addedAmountB, uint256 addedLiquidity);\n\tfunction removeLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToRemove, uint256 minReclaimedA, uint256 minReclaimedB, uint256 totalLiquidity ) external returns (uint256 reclaimedA, uint256 reclaimedB);\n\n\tfunction deposit( IERC20 token, uint256 amount ) external;\n\tfunction withdraw( IERC20 token, uint256 amount ) external;\n\tfunction swap( IERC20 swapTokenIn, IERC20 swapTokenOut, uint256 swapAmountIn, uint256 minAmountOut, uint256 deadline ) external returns (uint256 swapAmountOut);\n\tfunction depositSwapWithdraw(IERC20 swapTokenIn, IERC20 swapTokenOut, uint256 swapAmountIn, uint256 minAmountOut, uint256 deadline ) external returns (uint256 swapAmountOut);\n\tfunction depositDoubleSwapWithdraw( IERC20 swapTokenIn, IERC20 swapTokenMiddle, IERC20 swapTokenOut, uint256 swapAmountIn, uint256 minAmountOut, uint256 deadline ) external returns (uint256 swapAmountOut);\n\tfunction depositZapSwapWithdraw(IERC20 swapTokenIn, IERC20 swapTokenOut, uint256 swapAmountIn ) external returns (uint256 swapAmountOut);\n\n\t// Views\n\tfunction exchangeIsLive() external view returns (bool);\n\tfunction getPoolReserves(IERC20 tokenA, IERC20 tokenB) external view returns (uint256 reserveA, uint256 reserveB);\n\tfunction depositedUserBalance(address user, IERC20 token) external view returns (uint256);\n\t}\n\n"
      },
      "src/staking/interfaces/IStakingConfig.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\n\ninterface IStakingConfig\n\t{\n\tfunction changeMinUnstakeWeeks(bool increase) external; // onlyOwner\n\tfunction changeMaxUnstakeWeeks(bool increase) external; // onlyOwner\n\tfunction changeMinUnstakePercent(bool increase) external; // onlyOwner\n\tfunction changeModificationCooldown(bool increase) external; // onlyOwner\n\n\t// Views\n    function minUnstakeWeeks() external view returns (uint256);\n    function maxUnstakeWeeks() external view returns (uint256);\n    function minUnstakePercent() external view returns (uint256);\n    function modificationCooldown() external view returns (uint256);\n\t}"
      },
      "src/pools/interfaces/IPoolsConfig.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\";\nimport \"./IPools.sol\";\n\n\ninterface IPoolsConfig\n\t{\n\tfunction whitelistPool( IERC20 tokenA, IERC20 tokenB ) external; // onlyOwner\n\tfunction unwhitelistPool( IERC20 tokenA, IERC20 tokenB ) external; // onlyOwner\n\tfunction changeMaximumWhitelistedPools(bool increase) external; // onlyOwner\n\n\t// Views\n    function maximumWhitelistedPools() external view returns (uint256);\n\n\tfunction numberOfWhitelistedPools() external view returns (uint256);\n\tfunction isWhitelisted( bytes32 poolID ) external view returns (bool);\n\tfunction whitelistedPools() external view returns (bytes32[] calldata);\n\tfunction underlyingTokenPair( bytes32 poolID ) external view returns (IERC20 tokenA, IERC20 tokenB);\n\n\t// Returns true if the token has been whitelisted (meaning it has been pooled with either WETH and USDC)\n\tfunction tokenHasBeenWhitelisted( IERC20 token, IERC20 weth, IERC20 usdc ) external view returns (bool);\n\t}"
      },
      "src/dao/interfaces/IDAOConfig.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\n\ninterface IDAOConfig\n\t{\n\tfunction changeBootstrappingRewards(bool increase) external; // onlyOwner\n\tfunction changePercentRewardsBurned(bool increase) external; // onlyOwner\n\tfunction changeBaseBallotQuorumPercent(bool increase) external; // onlyOwner\n\tfunction changeBallotDuration(bool increase) external; // onlyOwner\n\tfunction changeBallotMaximumDuration(bool increase) external; // onlyOwner\n\tfunction changeRequiredProposalPercentStake(bool increase) external; // onlyOwner\n\tfunction changePercentRewardsForReserve(bool increase) external; // onlyOwner\n\tfunction changeUpkeepRewardPercent(bool increase) external; // onlyOwner\n\n\t// Views\n    function bootstrappingRewards() external view returns (uint256);\n    function percentRewardsBurned() external view returns (uint256);\n    function baseBallotQuorumPercentTimes1000() external view returns (uint256);\n    function ballotMinimumDuration() external view returns (uint256);\n    function ballotMaximumDuration() external view returns (uint256);\n    function requiredProposalPercentStakeTimes1000() external view returns (uint256);\n    function percentRewardsForReserve() external view returns (uint256);\n    function upkeepRewardPercent() external view returns (uint256);\n\t}"
      },
      "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/IERC20Permit.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using Address for address;\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(IERC20 token, address spender, uint256 value) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        require(\n            (value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        unchecked {\n            uint256 oldAllowance = token.allowance(address(this), spender);\n            require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n     * to be set to zero before setting it to a non-zero value, such as USDT.\n     */\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\n        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n        if (!_callOptionalReturnBool(token, approvalCall)) {\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n            _callOptionalReturn(token, approvalCall);\n        }\n    }\n\n    /**\n     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n     * Revert on invalid signature.\n     */\n    function safePermit(\n        IERC20Permit token,\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal {\n        uint256 nonceBefore = token.nonces(owner);\n        token.permit(owner, spender, value, deadline, v, r, s);\n        uint256 nonceAfter = token.nonces(owner);\n        require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n        require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n        // and not revert is the subcall reverts.\n\n        (bool success, bytes memory returndata) = address(token).call(data);\n        return\n            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n    }\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/utils/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     *\n     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check isContract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(isContract(target), \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/utils/Context.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n}\n"
      },
      "src/launch/interfaces/IBootstrapBallot.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\n\ninterface IBootstrapBallot\n\t{\n\tfunction vote( bool voteStartExchangeYes, uint256 saltAmount, bytes calldata signature ) external;\n\tfunction finalizeBallot() external;\n\n\tfunction authorizeAirdrop2( uint256 saltAmount, bytes calldata signature ) external;\n\tfunction finalizeAirdrop2() external;\n\n\t// Views\n\tfunction claimableTimestamp1() external view returns (uint256);\n\tfunction claimableTimestamp2() external view returns (uint256);\n\n\tfunction hasVoted(address user) external view returns (bool);\n\tfunction ballotFinalized() external view returns (bool);\n\n\tfunction startExchangeYes() external view returns (uint256);\n\tfunction startExchangeNo() external view returns (uint256);\n\t}\n"
      },
      "src/pools/interfaces/IPoolStats.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\n\ninterface IPoolStats\n\t{\n\t// These are the indicies (in terms of a poolIDs location in the current whitelistedPoolIDs array) of pools involved in an arbitrage path\n\tstruct ArbitrageIndicies\n\t\t{\n\t\tuint64 index1;\n\t\tuint64 index2;\n\t\tuint64 index3;\n\t\t}\n\n\tfunction clearProfitsForPools() external;\n\tfunction updateArbitrageIndicies() external;\n\n\t// Views\n\tfunction profitsForWhitelistedPools() external view returns (uint256[] memory _calculatedProfits);\n\tfunction arbitrageIndicies(bytes32 poolID) external view returns (ArbitrageIndicies memory);\n\t}\n\n"
      },
      "lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n    /**\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n\n    /**\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "chainlink/=lib/chainlink/",
        "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
        "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
        "forge-std/=lib/openzeppelin-contracts/lib/forge-std/src/",
        "openzeppelin-contracts/=lib/openzeppelin-contracts/",
        "openzeppelin/=lib/openzeppelin-contracts/contracts/",
        "v3-core/=lib/v3-core/contracts/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 10000
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "libraries": {}
    }
  }}