creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/dao/Proposals.sol": {
        "content": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport \"openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol\";\nimport \"openzeppelin-contracts/contracts/security/ReentrancyGuard.sol\";\nimport \"openzeppelin-contracts/contracts/utils/Strings.sol\";\nimport \"../pools/interfaces/IPoolsConfig.sol\";\nimport \"../staking/interfaces/IStaking.sol\";\nimport \"../interfaces/IExchangeConfig.sol\";\nimport \"./interfaces/IDAOConfig.sol\";\nimport \"./interfaces/IProposals.sol\";\n\n\n// Allows SALT stakers to propose and vote on various types of ballots such as parameter changes, token whitelisting/unwhitelisting, sending tokens, calling contracts, and updating website URLs.\n// Ensures ballot uniqueness, tracks and validates user voting power, enforces quorums, and provides a mechanism for users to alter votes.\n\ncontract Proposals is IProposals, ReentrancyGuard\n    {\n    event ProposalCreated(uint256 indexed ballotID, BallotType ballotType, string ballotName);\n    event BallotFinalized(uint256 indexed ballotID);\n    event VoteCast(address indexed voter, uint256 indexed ballotID, Vote vote, uint256 votingPower);\n\n    using EnumerableSet for EnumerableSet.UintSet;\n\n    IStaking immutable public staking;\n    IExchangeConfig immutable public exchangeConfig;\n    IPoolsConfig immutable public poolsConfig;\n    IDAOConfig immutable public daoConfig;\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    uint256 constant NUMBER_OF_PARAMETERS = 16;\n\n\t// Mapping from ballotName to a currently open ballotID (zero if none).\n\t// Used to check for existing ballots by name so as to not allow duplicate ballots to be created.\n\tmapping(string=>uint256) public openBallotsByName;\n\n\t// Maps ballotID to the corresponding Ballot\n\tmapping(uint256=>Ballot) public ballots;\n\tuint256 public nextBallotID = 1;\n\n\t// All of the ballotIDs that are currently open for voting\n\tEnumerableSet.UintSet private _allOpenBallots;\n\n\t// The ballotIDs of the tokens currently being proposed for whitelisting\n\tEnumerableSet.UintSet private _openBallotsForTokenWhitelisting;\n\n\t// The number of votes cast for a given ballot by Vote type\n\tmapping(uint256=>mapping(Vote=>uint256)) private _votesCastForBallot;\n\n\t// The last vote cast by a user for a given ballot.\n\t// Allows users to change their vote - so that the previous vote can be undone before casting the new vote.\n\tmapping(uint256=>mapping(address=>UserVote)) private _lastUserVoteForBallot;\n\n\t// Which users currently have active proposals\n\t// Useful for checking that users are only able to create one active proposal at a time (to discourage spam proposals).\n\tmapping(address=>bool) private _userHasActiveProposal;\n\n\t// Which users proposed which ballots.\n\t// Useful when a ballot is finalized - so that the user that proposed it can have their _usersWithActiveProposals status cleared\n\tmapping(uint256=>address) private _usersThatProposedBallots;\n\n\t// The time at which the first proposal can be made (45 days after deployment).\n\t// This is to allow some time for users to start staking - as some percent of stake is required to propose ballots and if the total amount staked.\n\tuint256 immutable firstPossibleProposalTimestamp = block.timestamp + 45 days;\n\n\n    constructor( IStaking _staking, IExchangeConfig _exchangeConfig, IPoolsConfig _poolsConfig, IDAOConfig _daoConfig )\n\t\t{\n\t\tstaking = _staking;\n\t\texchangeConfig = _exchangeConfig;\n\t\tpoolsConfig = _poolsConfig;\n\t\tdaoConfig = _daoConfig;\n        }\n\n\n\tfunction _possiblyCreateProposal( string memory ballotName, BallotType ballotType, address address1, uint256 number1, string memory string1, string memory string2 ) internal returns (uint256 ballotID)\n\t\t{\n\t\trequire( block.timestamp >= firstPossibleProposalTimestamp, \"Cannot propose ballots within the first 45 days of deployment\" );\n\n\t\t// The DAO can create confirmation proposals which won't have the below requirements\n\t\tif ( msg.sender != address(exchangeConfig.dao() ) )\n\t\t\t{\n\t\t\t// Make sure that the sender has the minimum amount of xSALT required to make the proposal\n\t\t\tuint256 totalStaked = staking.totalShares(STAKED_SALT);\n\t\t\tuint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n\n\t\t\trequire( requiredXSalt > 0, \"requiredXSalt cannot be zero\" );\n\n\t\t\tuint256 userXSalt = staking.userShareForPool( msg.sender, STAKED_SALT );\n\t\t\trequire( userXSalt >= requiredXSalt, \"Sender does not have enough xSALT to make the proposal\" );\n\n\t\t\t// Make sure that the user doesn't already have an active proposal\n\t\t\trequire( ! _userHasActiveProposal[msg.sender], \"Users can only have one active proposal at a time\" );\n\t\t\t}\n\n\t\t// Make sure that a proposal of the same name is not already open for the ballot\n\t\trequire( openBallotsByName[ballotName] == 0, \"Cannot create a proposal similar to a ballot that is still open\" );\n\t\trequire( openBallotsByName[ string.concat(\"confirm_\", ballotName)] == 0, \"Cannot create a proposal for a ballot with a secondary confirmation\" );\n\n\t\tuint256 ballotMinimumEndTime = block.timestamp + daoConfig.ballotMinimumDuration();\n\t\tuint256 ballotMaximumEndTime = block.timestamp + daoConfig.ballotMaximumDuration();\n\n\t\t// Add the new Ballot to storage\n\t\tballotID = nextBallotID++;\n\n \t\tuint requiredQuorum = requiredQuorumForBallotType(ballotType);\n \t\tballots[ballotID] = Ballot( ballotID, true, ballotType, ballotName, address1, number1, string1, string2, ballotMinimumEndTime, ballotMaximumEndTime, requiredQuorum );\n\n\t\topenBallotsByName[ballotName] = ballotID;\n\t\t_allOpenBallots.add( ballotID );\n\n\t\t// Remember that the user made a proposal\n\t\t_userHasActiveProposal[msg.sender] = true;\n\t\t_usersThatProposedBallots[ballotID] = msg.sender;\n\n\t\temit ProposalCreated(ballotID, ballotType, ballotName);\n\t\t}\n\n\n\t// Create a confirmation proposal from the DAO\n\tfunction createConfirmationProposal( string calldata ballotName, BallotType ballotType, address address1, string calldata string1, string calldata description ) external returns (uint256 ballotID)\n\t\t{\n\t\trequire( msg.sender == address(exchangeConfig.dao()), \"Only the DAO can create a confirmation proposal\" );\n\n\t\treturn _possiblyCreateProposal( ballotName, ballotType, address1, 0, string1, description );\n\t\t}\n\n\n\tfunction markBallotAsFinalized( uint256 ballotID ) external nonReentrant\n\t\t{\n\t\trequire( msg.sender == address(exchangeConfig.dao()), \"Only the DAO can mark a ballot as finalized\" );\n\n\t\tBallot storage ballot = ballots[ballotID];\n\t\trequire( ballot.ballotIsLive, \"The ballot has already been finalized\" );\n\n\t\t// Remove finalized whitelist token ballots from the list of open whitelisting proposals\n\t\tif ( ballot.ballotType == BallotType.WHITELIST_TOKEN )\n\t\t\t_openBallotsForTokenWhitelisting.remove( ballotID );\n\n\t\t// Remove from the list of all open ballots\n\t\t_allOpenBallots.remove( ballotID );\n\n\t\tballot.ballotIsLive = false;\n\n\t\t// Indicate that the user who posted the proposal no longer has an active proposal\n\t\taddress userThatPostedBallot = _usersThatProposedBallots[ballotID];\n\t\t_userHasActiveProposal[userThatPostedBallot] = false;\n\n\t\tdelete openBallotsByName[ballot.ballotName];\n\n\t\temit BallotFinalized(ballotID);\n\t\t}\n\n\n\tfunction proposeParameterBallot( uint256 parameterType, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\trequire( parameterType < NUMBER_OF_PARAMETERS, \"Invalid parameterType\" );\n\n\t\tstring memory ballotName = string.concat(\"parameter:\", Strings.toString(parameterType), description );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.PARAMETER, address(0), parameterType, \"\", description );\n\t\t}\n\n\n\tfunction proposeTokenWhitelisting( IERC20 token, string calldata tokenIconURL, string calldata description ) external nonReentrant returns (uint256 _ballotID)\n\t\t{\n\t\trequire( address(token) != address(0), \"token cannot be address(0)\" );\n\t\trequire( token.totalSupply() < type(uint112).max, \"Token supply cannot exceed uint112.max\" ); // 5 quadrillion max supply with 18 decimals of precision\n\t\trequire( IERC20Metadata(address(token)).decimals() <= 18, \"Token decimal maximum is 18\" );\n\n\t\trequire( poolsConfig.numberOfWhitelistedPools() < poolsConfig.maximumWhitelistedPools(), \"Maximum number of whitelisted pools already reached\" );\n\t\trequire( ! poolsConfig.tokenHasBeenWhitelisted(token, exchangeConfig.weth(), exchangeConfig.usdc()), \"The token has already been whitelisted\" );\n\n\t\tstring memory ballotName = string.concat(\"whitelist:\", Strings.toHexString(address(token)), tokenIconURL, description );\n\n\t\tuint256 ballotID = _possiblyCreateProposal( ballotName, BallotType.WHITELIST_TOKEN, address(token), 0, tokenIconURL, description );\n\t\t_openBallotsForTokenWhitelisting.add( ballotID );\n\n\t\treturn ballotID;\n\t\t}\n\n\n\tfunction proposeTokenUnwhitelisting( IERC20 token, string calldata tokenIconURL, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\trequire( poolsConfig.tokenHasBeenWhitelisted(token, exchangeConfig.weth(), exchangeConfig.usdc()), \"Can only unwhitelist a whitelisted token\" );\n\t\trequire( address(token) != address(exchangeConfig.wbtc()), \"Cannot unwhitelist WBTC\" );\n\t\trequire( address(token) != address(exchangeConfig.weth()), \"Cannot unwhitelist WETH\" );\n\t\trequire( address(token) != address(exchangeConfig.usdc()), \"Cannot unwhitelist USDC\" );\n\t\trequire( address(token) != address(exchangeConfig.usdt()), \"Cannot unwhitelist USDT\" );\n\t\trequire( address(token) != address(exchangeConfig.salt()), \"Cannot unwhitelist SALT\" );\n\n\t\tstring memory ballotName = string.concat(\"unwhitelist:\", Strings.toHexString(address(token)), tokenIconURL, description );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.UNWHITELIST_TOKEN, address(token), 0, tokenIconURL, description );\n\t\t}\n\n\n\t// Proposes sending a specified amount of SALT to a wallet or contract.\n\t// Only one sendSALT Ballot can be open at a time and the sending limit is 5% of the current SALT balance of the DAO.\n\tfunction proposeSendSALT( address wallet, uint256 amount, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\trequire( wallet != address(0), \"Cannot send SALT to address(0)\" );\n\n\t\t// Limit to 5% of current balance\n\t\tuint256 balance = exchangeConfig.salt().balanceOf( address(exchangeConfig.dao()) );\n\t\tuint256 maxSendable = balance * 5 / 100;\n\t\trequire( amount <= maxSendable, \"Cannot send more than 5% of the DAO SALT balance\" );\n\n\t\tstring memory ballotName = string.concat(\"sendSALT:\", Strings.toHexString(wallet), Strings.toString(amount), description );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.SEND_SALT, wallet, amount, \"\", description );\n\t\t}\n\n\n\t// Proposes calling the callFromDAO(uint256) function on an arbitrary contract.\n\tfunction proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\trequire( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n\t\tstring memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)), Strings.toString(number), description );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, \"\", description );\n\t\t}\n\n\n\tfunction _checkCountryCode( string calldata countryCode ) internal pure\n\t\t{\n\t\trequire( bytes(countryCode).length == 2, \"Country must be an ISO 3166 Alpha-2 Code\" );\n\t\trequire(bytes(countryCode)[0] >= 0x41 && bytes(countryCode)[0] <= 0x5A && bytes(countryCode)[1] >= 0x41 && bytes(countryCode)[1] <= 0x5A, \"Invalid country code\");\n\t\t}\n\n\n\tfunction proposeCountryInclusion( string calldata countryCode, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\t_checkCountryCode(countryCode);\n\t\trequire(exchangeConfig.dao().countryIsExcluded(countryCode), \"Country is not excluded\");\n\n\t\tstring memory ballotName = string.concat(\"include:\", countryCode, description );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.INCLUDE_COUNTRY, address(0), 0, countryCode, description );\n\t\t}\n\n\n\tfunction proposeCountryExclusion( string calldata countryCode, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\t_checkCountryCode(countryCode);\n\t\trequire( ! exchangeConfig.dao().countryIsExcluded(countryCode), \"Country is already excluded\");\n\n\t\tstring memory ballotName = string.concat(\"exclude:\", countryCode, description );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.EXCLUDE_COUNTRY, address(0), 0, countryCode, description );\n\t\t}\n\n\n\tfunction proposeSetAccessManager( address newAddress, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\trequire( newAddress != address(0), \"Proposed address cannot be address(0)\" );\n\n\t\tstring memory ballotName = string.concat(\"setAccessManager:\", Strings.toHexString(newAddress), description );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.SET_ACCESS_MANAGER, newAddress, 0, \"\", description );\n\t\t}\n\n\n\tfunction proposeWebsiteUpdate( string calldata newWebsiteURL, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\trequire( keccak256(abi.encodePacked(newWebsiteURL)) != keccak256(abi.encodePacked(\"\")), \"newWebsiteURL cannot be empty\" );\n\n\t\tfor (uint i = 0; i < bytes(newWebsiteURL).length; i++)\n\t\t\trequire(bytes(newWebsiteURL)[i] >= 0x2D && bytes(newWebsiteURL)[i] <= 0x7A, \"Invalid character in URL\");\n\n\t\tstring memory ballotName = string.concat(\"setURL:\", newWebsiteURL, description );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.SET_WEBSITE_URL, address(0), 0, newWebsiteURL, description );\n\t\t}\n\n\n\t// Cast a vote on an open ballot\n\tfunction castVote( uint256 ballotID, Vote vote ) external nonReentrant\n\t\t{\n\t\tBallot memory ballot = ballots[ballotID];\n\n\t\t// Require that the ballot is actually live\n\t\trequire( ballot.ballotIsLive, \"The specified ballot is not open for voting\" );\n\n\t\t// Make sure that the vote type is valid for the given ballot\n\t\tif ( ballot.ballotType == BallotType.PARAMETER )\n\t\t\trequire( (vote == Vote.INCREASE) || (vote == Vote.DECREASE) || (vote == Vote.NO_CHANGE), \"Invalid VoteType for Parameter Ballot\" );\n\t\telse // If a Ballot is not a Parameter Ballot, it is an Approval ballot\n\t\t\trequire( (vote == Vote.YES) || (vote == Vote.NO), \"Invalid VoteType for Approval Ballot\" );\n\n\t\t// Make sure that the user has voting power before proceeding.\n\t\t// Voting power is equal to their userShare of STAKED_SALT.\n\t\t// If the user changes their stake after voting they will have to recast their vote.\n\n\t\tuint256 userVotingPower = staking.userShareForPool( msg.sender, STAKED_SALT );\n\t\trequire( userVotingPower > 0, \"Staked SALT required to vote\" );\n\n\t\t// Remove any previous votes made by the user on the ballot\n\t\tUserVote memory lastVote = _lastUserVoteForBallot[ballotID][msg.sender];\n\n\t\t// Undo the last vote?\n\t\tif ( lastVote.votingPower > 0 )\n\t\t\t_votesCastForBallot[ballotID][lastVote.vote] -= lastVote.votingPower;\n\n\t\t// Update the votes cast for the ballot with the user's current voting power\n\t\t_votesCastForBallot[ballotID][vote] += userVotingPower;\n\n\t\t// Remember how the user voted in case they change their vote later\n\t\t_lastUserVoteForBallot[ballotID][msg.sender] = UserVote( vote, userVotingPower );\n\n\t\temit VoteCast(msg.sender, ballotID, vote, userVotingPower);\n\t\t}\n\n\n\t// === VIEWS ===\n\tfunction ballotForID( uint256 ballotID ) external view returns (Ballot memory)\n\t\t{\n\t\treturn ballots[ballotID];\n\t\t}\n\n\n\tfunction lastUserVoteForBallot( uint256 ballotID, address user ) external view returns (UserVote memory)\n\t\t{\n\t\treturn _lastUserVoteForBallot[ballotID][user];\n\t\t}\n\n\n\tfunction votesCastForBallot( uint256 ballotID, Vote vote ) external view returns (uint256)\n\t\t{\n\t\treturn _votesCastForBallot[ballotID][vote];\n\t\t}\n\n\n\t// The required quorum is normally a default 10% of the amount of SALT staked.\n\t// There is though a minimum of 0.50% of SALT.totalSupply\n\tfunction requiredQuorumForBallotType( BallotType ballotType ) public view returns (uint256 requiredQuorum)\n\t\t{\n\t\t// The quorum will be specified as a percentage of the total amount of SALT staked\n\t\tuint256 totalStaked = staking.totalShares( STAKED_SALT );\n\t\trequire( totalStaked != 0, \"SALT staked cannot be zero to determine quorum\" );\n\n\t\tif ( ballotType == BallotType.PARAMETER )\n\t\t\trequiredQuorum = ( 1 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 );\n\t\telse if ( ( ballotType == BallotType.WHITELIST_TOKEN ) || ( ballotType == BallotType.UNWHITELIST_TOKEN ) )\n\t\t\trequiredQuorum = ( 2 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 );\n\t\telse\n\t\t\t// All other ballot types require 3x multiple of the baseQuorum\n\t\t\trequiredQuorum = ( 3 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 );\n\n\t\t// Make sure that the requiredQuorum is at least 0.50% of the total SALT supply.\n\t\t// Circulating supply after the first 45 days of emissions will be about 8 million - so this would require about 6% of the circulating\n\t\t// SALT to be staked and voting to pass a proposal (including whitelisting) 45 days after deployment..\n\t\tuint256 totalSupply = IERC20Metadata(address(exchangeConfig.salt())).totalSupply();\n\t\tuint256 minimumQuorum = totalSupply * 5 / 1000;\n\n\t\tif ( requiredQuorum < minimumQuorum )\n\t\t\trequiredQuorum = minimumQuorum;\n\t\t}\n\n\n\tfunction totalVotesCastForBallot( uint256 ballotID ) public view returns (uint256)\n\t\t{\n\t\tmapping(Vote=>uint256) storage votes = _votesCastForBallot[ballotID];\n\n\t\tBallot memory ballot = ballots[ballotID];\n\t\tif ( ballot.ballotType == BallotType.PARAMETER )\n\t\t\treturn votes[Vote.INCREASE] + votes[Vote.DECREASE] + votes[Vote.NO_CHANGE];\n\t\telse\n\t\t\treturn votes[Vote.YES] + votes[Vote.NO];\n\t\t}\n\n\n\t// Assumes that the quorum has been checked elsewhere\n\tfunction ballotIsApproved( uint256 ballotID ) external view returns (bool)\n\t\t{\n\t\tmapping(Vote=>uint256) storage votes = _votesCastForBallot[ballotID];\n\n\t\treturn votes[Vote.YES] > votes[Vote.NO];\n\t\t}\n\n\n\t// Assumes that the quorum has been checked elsewhere\n\tfunction winningParameterVote( uint256 ballotID ) external view returns (Vote)\n\t\t{\n\t\tmapping(Vote=>uint256) storage votes = _votesCastForBallot[ballotID];\n\n\t\tuint256 increaseTotal = votes[Vote.INCREASE];\n\t\tuint256 decreaseTotal = votes[Vote.DECREASE];\n\t\tuint256 noChangeTotal = votes[Vote.NO_CHANGE];\n\n\t\tif ( increaseTotal > decreaseTotal )\n\t\tif ( increaseTotal > noChangeTotal )\n\t\t\treturn Vote.INCREASE;\n\n\t\tif ( decreaseTotal > increaseTotal )\n\t\tif ( decreaseTotal > noChangeTotal )\n\t\t\treturn Vote.DECREASE;\n\n\t\treturn Vote.NO_CHANGE;\n\t\t}\n\n\n\t// Checks that ballot is live, and minimumEndTime and quorum have both been reached.\n\tfunction canFinalizeBallot( uint256 ballotID ) external view returns (bool)\n\t\t{\n        Ballot memory ballot = ballots[ballotID];\n        if ( ! ballot.ballotIsLive )\n        \treturn false;\n\n        // Check that the minimum duration has passed\n        if (block.timestamp < ballot.ballotMinimumEndTime )\n            return false;\n\n        // Check that the required quorum has been reached\n        if ( totalVotesCastForBallot(ballotID) < ballot.requiredQuorum)\n            return false;\n\n        return true;\n\t    }\n\n\n\tfunction openBallots() external view returns (uint256[] memory)\n\t\t{\n\t\treturn _allOpenBallots.values();\n\t\t}\n\n\n\tfunction openBallotsForTokenWhitelisting() external view returns (uint256[] memory)\n\t\t{\n\t\treturn _openBallotsForTokenWhitelisting.values();\n\t\t}\n\n\n\tfunction userHasActiveProposal( address user ) external view returns (bool)\n\t\t{\n\t\treturn _userHasActiveProposal[user];\n\t\t}\n\t}"
      },
      "lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n *     // Add the library methods\n *     using EnumerableSet for EnumerableSet.AddressSet;\n *\n *     // Declare a set state variable\n *     EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n    // To implement this library for multiple types with as little code\n    // repetition as possible, we write it in terms of a generic Set type with\n    // bytes32 values.\n    // The Set implementation uses private functions, and user-facing\n    // implementations (such as AddressSet) are just wrappers around the\n    // underlying Set.\n    // This means that we can only create new EnumerableSets for types that fit\n    // in bytes32.\n\n    struct Set {\n        // Storage of set values\n        bytes32[] _values;\n        // Position of the value in the `values` array, plus 1 because index 0\n        // means a value is not in the set.\n        mapping(bytes32 => uint256) _indexes;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function _add(Set storage set, bytes32 value) private returns (bool) {\n        if (!_contains(set, value)) {\n            set._values.push(value);\n            // The value is stored at length-1, but we add 1 to all indexes\n            // and use 0 as a sentinel value\n            set._indexes[value] = set._values.length;\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function _remove(Set storage set, bytes32 value) private returns (bool) {\n        // We read and store the value's index to prevent multiple reads from the same storage slot\n        uint256 valueIndex = set._indexes[value];\n\n        if (valueIndex != 0) {\n            // Equivalent to contains(set, value)\n            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n            // the array, and then remove the last element (sometimes called as 'swap and pop').\n            // This modifies the order of the array, as noted in {at}.\n\n            uint256 toDeleteIndex = valueIndex - 1;\n            uint256 lastIndex = set._values.length - 1;\n\n            if (lastIndex != toDeleteIndex) {\n                bytes32 lastValue = set._values[lastIndex];\n\n                // Move the last value to the index where the value to delete is\n                set._values[toDeleteIndex] = lastValue;\n                // Update the index for the moved value\n                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n            }\n\n            // Delete the slot where the moved value was stored\n            set._values.pop();\n\n            // Delete the index for the deleted slot\n            delete set._indexes[value];\n\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function _contains(Set storage set, bytes32 value) private view returns (bool) {\n        return set._indexes[value] != 0;\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function _length(Set storage set) private view returns (uint256) {\n        return set._values.length;\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function _at(Set storage set, uint256 index) private view returns (bytes32) {\n        return set._values[index];\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function _values(Set storage set) private view returns (bytes32[] memory) {\n        return set._values;\n    }\n\n    // Bytes32Set\n\n    struct Bytes32Set {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _add(set._inner, value);\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _remove(set._inner, value);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n        return _contains(set._inner, value);\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(Bytes32Set storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n        return _at(set._inner, index);\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        bytes32[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // AddressSet\n\n    struct AddressSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(AddressSet storage set, address value) internal returns (bool) {\n        return _add(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(AddressSet storage set, address value) internal returns (bool) {\n        return _remove(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(AddressSet storage set, address value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(AddressSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(AddressSet storage set, uint256 index) internal view returns (address) {\n        return address(uint160(uint256(_at(set._inner, index))));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(AddressSet storage set) internal view returns (address[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        address[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // UintSet\n\n    struct UintSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(UintSet storage set, uint256 value) internal returns (bool) {\n        return _add(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(UintSet storage set, uint256 value) internal returns (bool) {\n        return _remove(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(UintSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n        return uint256(_at(set._inner, index));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(UintSet storage set) internal view returns (uint256[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        uint256[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n}\n"
      },
      "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"
      },
      "lib/openzeppelin-contracts/contracts/utils/Strings.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\nimport \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n    uint8 private constant _ADDRESS_LENGTH = 20;\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            uint256 length = Math.log10(value) + 1;\n            string memory buffer = new string(length);\n            uint256 ptr;\n            /// @solidity memory-safe-assembly\n            assembly {\n                ptr := add(buffer, add(32, length))\n            }\n            while (true) {\n                ptr--;\n                /// @solidity memory-safe-assembly\n                assembly {\n                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n                }\n                value /= 10;\n                if (value == 0) break;\n            }\n            return buffer;\n        }\n    }\n\n    /**\n     * @dev Converts a `int256` to its ASCII `string` decimal representation.\n     */\n    function toString(int256 value) internal pure returns (string memory) {\n        return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value))));\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            return toHexString(value, Math.log256(value) + 1);\n        }\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = _SYMBOLS[value & 0xf];\n            value >>= 4;\n        }\n        require(value == 0, \"Strings: hex length insufficient\");\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n     */\n    function toHexString(address addr) internal pure returns (string memory) {\n        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n    }\n\n    /**\n     * @dev Returns true if the two strings are equal.\n     */\n    function equal(string memory a, string memory b) internal pure returns (bool) {\n        return keccak256(bytes(a)) == keccak256(bytes(b));\n    }\n}\n"
      },
      "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/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/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/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}"
      },
      "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}"
      },
      "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"
      },
      "lib/openzeppelin-contracts/contracts/utils/math/Math.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Down, // Toward negative infinity\n        Up, // Toward infinity\n        Zero // Toward zero\n    }\n\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.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds up instead\n     * of rounding down.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b - 1) / b can overflow on addition, so we distribute.\n        return a == 0 ? 0 : (a - 1) / b + 1;\n    }\n\n    /**\n     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n     * with further edits by Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n            // variables such that product = prod1 * 2^256 + prod0.\n            uint256 prod0; // Least significant 256 bits of the product\n            uint256 prod1; // Most significant 256 bits of the product\n            assembly {\n                let mm := mulmod(x, y, not(0))\n                prod0 := mul(x, y)\n                prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n            }\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (prod1 == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2^256. Also prevents denominator == 0.\n            require(denominator > prod1, \"Math: mulDiv overflow\");\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [prod1 prod0].\n            uint256 remainder;\n            assembly {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                prod1 := sub(prod1, gt(remainder, prod0))\n                prod0 := sub(prod0, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n            // See https://cs.stackexchange.com/q/138556/92363.\n\n            // Does not overflow because the denominator cannot be zero at this stage in the function.\n            uint256 twos = denominator & (~denominator + 1);\n            assembly {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [prod1 prod0] by twos.\n                prod0 := div(prod0, twos)\n\n                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from prod1 into prod0.\n            prod0 |= prod1 * twos;\n\n            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv = 1 mod 2^4.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n            // in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2^8\n            inverse *= 2 - denominator * inverse; // inverse mod 2^16\n            inverse *= 2 - denominator * inverse; // inverse mod 2^32\n            inverse *= 2 - denominator * inverse; // inverse mod 2^64\n            inverse *= 2 - denominator * inverse; // inverse mod 2^128\n            inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n            // is no longer required.\n            result = prod0 * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        uint256 result = mulDiv(x, y, denominator);\n        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n            result += 1;\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n     *\n     * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        if (a == 0) {\n            return 0;\n        }\n\n        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n        //\n        // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n        //\n        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n        //\n        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n        uint256 result = 1 << (log2(a) >> 1);\n\n        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n        // into the expected uint128 result.\n        unchecked {\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            return min(result, a / result);\n        }\n    }\n\n    /**\n     * @notice Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 128;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 64;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 32;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 16;\n            }\n            if (value >> 8 > 0) {\n                value >>= 8;\n                result += 8;\n            }\n            if (value >> 4 > 0) {\n                value >>= 4;\n                result += 4;\n            }\n            if (value >> 2 > 0) {\n                value >>= 2;\n                result += 2;\n            }\n            if (value >> 1 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 16;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 8;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 4;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 2;\n            }\n            if (value >> 8 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n        }\n    }\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n    /**\n     * @dev Returns the largest of two signed numbers.\n     */\n    function max(int256 a, int256 b) internal pure returns (int256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two signed numbers.\n     */\n    function min(int256 a, int256 b) internal pure returns (int256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two signed numbers without overflow.\n     * The result is rounded towards zero.\n     */\n    function average(int256 a, int256 b) internal pure returns (int256) {\n        // Formula from the book \"Hacker's Delight\"\n        int256 x = (a & b) + ((a ^ b) >> 1);\n        return x + (int256(uint256(x) >> 255) & (a ^ b));\n    }\n\n    /**\n     * @dev Returns the absolute unsigned value of a signed value.\n     */\n    function abs(int256 n) internal pure returns (uint256) {\n        unchecked {\n            // must be unchecked in order to support `n = type(int256).min`\n            return uint256(n >= 0 ? n : -n);\n        }\n    }\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/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/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/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/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/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/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/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"
      },
      "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/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"
      },
      "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": {}
    }
  }}