creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/fundraising/contracts/fundraising/facets/milestone/InvestorClaimMilestoneFacet.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports - constants, encoders, events, errors, structs\nimport { MilestoneConstants } from \"../../constants/MilestoneConstants.sol\";\nimport { MilestoneEncoder } from \"../../encoders/MilestoneEncoder.sol\";\nimport { MilestoneEvents } from \"../../events/MilestoneEvents.sol\";\nimport { MilestoneErrors } from \"../../errors/MilestoneErrors.sol\";\nimport { RequestTypes } from \"../../structs/RequestTypes.sol\";\n\n// Local imports - storages\nimport { LibERC20Asset } from \"../../libraries/storage/assets/LibERC20Asset.sol\";\nimport { LibEscrow } from \"../../libraries/storage/assets/LibEscrow.sol\";\nimport { LibMilestone } from \"../../libraries/storage/milestone/LibMilestone.sol\";\n\n// Local imports - services\nimport { InvestorClaimMilestoneService } from \"../../libraries/services/milestone/InvestorClaimMilestoneService.sol\";\nimport { InvestorClaimService } from \"../../libraries/services/milestone/internal/InvestorClaimService.sol\";\nimport { RequestService } from \"../../libraries/services/utils/RequestService.sol\";\nimport { SignatureService } from \"../../libraries/services/utils/SignatureService.sol\";\nimport { RaiseService } from \"../../libraries/services/raise/internal/RaiseService.sol\";\n\n// Local imports - interfaces\nimport { IInvestorClaimMilestoneFacet } from \"../../interfaces/milestone/IInvestorClaimMilestoneFacet.sol\";\n\n/**************************************\n\n    Investor claim milestone facet\n\n**************************************/\n\n/// @notice Milestone facet implementing claiming of unlocked milestones for investor.\ncontract InvestorClaimMilestoneFacet is IInvestorClaimMilestoneFacet {\n    // -----------------------------------------------------------------------\n    //                              Claim\n    // -----------------------------------------------------------------------\n\n    /// @dev Claim milestone by investor.\n    /// @dev Validation: Requires raise that is finished and has reached softcap.\n    /// @dev Validation: Can be only called by user that invested in raise.\n    /// @dev Validation: Requires valid cosignature from AngelBlock validator to execute.\n    /// @dev Events: InvestorClaimed(string raiseId, address erc20, address startup, uint256 claimed).\n    /// @param _request InvestorClaimRequest struct\n    /// @param _message EIP712 messages that contains request\n    /// @param _v Part of signature for message\n    /// @param _r Part of signature for message\n    /// @param _s Part of signature for message\n    function claimMilestoneInvestor(\n        RequestTypes.InvestorClaimRequest calldata _request,\n        bytes32 _message,\n        uint8 _v,\n        bytes32 _r,\n        bytes32 _s\n    ) external {\n        // tx.members\n        address sender_ = msg.sender;\n\n        // validation\n        RequestService.validateBaseRequest(_request.base);\n        RaiseService.validateCompletedRaise(_request.raiseId);\n        InvestorClaimMilestoneService.validateClaimMilestoneInvestor(_request.raiseId, sender_, _request.investment, _request.proofs);\n\n        // get available\n        uint256 available_ = InvestorClaimMilestoneService.getAvailableForInvestor(_request.raiseId, sender_, _request.investment);\n        if (available_ == 0) revert MilestoneErrors.NothingToClaim(_request.raiseId, sender_);\n\n        // encode message\n        bytes memory encodedMsg_ = MilestoneEncoder.encodeInvestorClaim(_request);\n\n        // verify message\n        SignatureService.verifyMessage(MilestoneConstants.EIP712_NAME, MilestoneConstants.EIP712_VERSION, keccak256(encodedMsg_), _message);\n\n        // verify signature\n        SignatureService.verifySignature(_message, _v, _r, _s);\n\n        // get erc20\n        address erc20_ = LibERC20Asset.getAddress(_request.raiseId);\n\n        // claim ERC20\n        LibMilestone.claimMilestoneInvestor(_request.raiseId, erc20_, LibEscrow.getEscrow(_request.raiseId), sender_, available_);\n\n        // events\n        emit MilestoneEvents.MilestoneUnlocked__InvestorClaimed(_request.raiseId, erc20_, sender_, available_);\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Get available\n    // -----------------------------------------------------------------------\n\n    /// @dev Get available funds to claim upon unlocked milestones by investor.\n    /// @param _raiseId ID of raise\n    /// @param _account Address of investor\n    /// @param _investment Investment of user\n    /// @param _proofs Merkle proofs for user and investment\n    /// @return Amount of ERC20 available for claim\n    function getAvailableForInvestor(\n        string memory _raiseId,\n        address _account,\n        uint256 _investment,\n        bytes32[] memory _proofs\n    ) external view returns (uint256) {\n        (bool validMerkle_, , ) = InvestorClaimService.verifyProofs(_raiseId, _account, _investment, _proofs);\n        if (validMerkle_) {\n            return InvestorClaimMilestoneService.getAvailableForInvestor(_raiseId, _account, _investment);\n        } else {\n            return 0;\n        }\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/constants/MilestoneConstants.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n/// @notice Constants used in milestone facet and milestone encoder.\nlibrary MilestoneConstants {\n    // -----------------------------------------------------------------------\n    //                              Constants\n    // -----------------------------------------------------------------------\n\n    /// @dev EIP712 name\n    bytes32 internal constant EIP712_NAME = keccak256(bytes(\"Fundraising:Milestone\"));\n    /// @dev EIP712 versioning: \"release:major:minor\"\n    bytes32 internal constant EIP712_VERSION = keccak256(bytes(\"2:1:0\"));\n\n    // typehashes\n    bytes32 internal constant VOTING_UNLOCK_MILESTONE_TYPEHASH = keccak256(\"UnlockMilestoneRequest(string raiseId,bytes milestone,bytes base)\");\n    bytes32 internal constant VOTING_UNLOCK_MILESTONE_RECEIVER_TYPEHASH =\n        keccak256(\"UnlockMilestoneReceiverRequest(string raiseId,bytes milestone,bytes crossChainBase)\");\n    bytes32 internal constant VOTING_REJECT_RAISE_TYPEHASH = keccak256(\"RejectRaiseRequest(string raiseId,bytes base)\");\n    bytes32 internal constant INVESTOR_CLAIM_TYPEHASH =\n        keccak256(\"InvestorClaimRequest(string raiseId,uint256 investment,bytes32[] proofs,bytes base)\");\n    bytes32 internal constant STARTUP_CLAIM_TYPEHASH = keccak256(\"StartupClaimRequest(string raiseId,bytes base)\");\n    bytes32 internal constant SUBMIT_CLAIMING_TYPEHASH =\n        keccak256(\"SubmitClaimingRequest(string raiseId,string milestoneId,bytes claimingSchedules,bytes base)\");\n    bytes32 internal constant SUBMIT_CLAIMING_RECEIVER_TYPEHASH =\n        keccak256(\"SubmitClaimingReceiverRequest(string raiseId,string milestoneId,bytes claimingSchedules,bytes crossChainBase)\");\n}\n"
      },
      "src/fundraising/contracts/fundraising/encoders/MilestoneEncoder.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports\nimport { MilestoneConstants } from \"../constants/MilestoneConstants.sol\";\nimport { RequestTypes } from \"../structs/RequestTypes.sol\";\n\n/**************************************\n\n    Milestone encoder\n\n**************************************/\n\n/// @notice Milestone encoder for EIP712 message hash.\nlibrary MilestoneEncoder {\n    /// @dev Encode unlock milestone request to validate the EIP712 message.\n    /// @param _request UnlockMilestoneRequest struct\n    /// @return EIP712 encoded message containing request\n    function encodeUnlockMilestone(RequestTypes.UnlockMilestoneRequest memory _request) internal pure returns (bytes memory) {\n        // milestone\n        bytes memory encodedMilestone_ = abi.encode(_request.milestone);\n\n        // base\n        bytes memory encodedBase_ = abi.encode(_request.base);\n\n        // msg\n        bytes memory encodedMsg_ = abi.encode(\n            MilestoneConstants.VOTING_UNLOCK_MILESTONE_TYPEHASH,\n            keccak256(bytes(_request.raiseId)),\n            keccak256(encodedMilestone_),\n            keccak256(encodedBase_)\n        );\n\n        // return\n        return encodedMsg_;\n    }\n\n    /// @dev Encode unlock milestone receiver request to validate the EIP712 message.\n    /// @param _request UnlockMilestoneReceiverRequest struct\n    /// @return EIP712 encoded message containing request\n    function encodeUnlockMilestoneReceiver(RequestTypes.UnlockMilestoneReceiverRequest memory _request) internal pure returns (bytes memory) {\n        // milestone\n        bytes memory encodedMilestone_ = abi.encode(_request.milestone);\n\n        // base\n        bytes memory encodedBase_ = abi.encode(_request.crossChainBase);\n\n        // msg\n        bytes memory encodedMsg_ = abi.encode(\n            MilestoneConstants.VOTING_UNLOCK_MILESTONE_RECEIVER_TYPEHASH,\n            keccak256(bytes(_request.raiseId)),\n            keccak256(encodedMilestone_),\n            keccak256(encodedBase_)\n        );\n\n        // return\n        return encodedMsg_;\n    }\n\n    /// @dev Encode investor claim milestone request to validate the EIP712 message.\n    /// @param _request InvestorClaimRequest struct\n    /// @return EIP712 encoded message containing request\n    function encodeInvestorClaim(RequestTypes.InvestorClaimRequest memory _request) internal pure returns (bytes memory) {\n        // base\n        bytes memory encodedBase_ = abi.encode(_request.base);\n\n        // msg\n        bytes memory encodedMsg_ = abi.encode(\n            MilestoneConstants.INVESTOR_CLAIM_TYPEHASH,\n            keccak256(bytes(_request.raiseId)),\n            _request.investment,\n            keccak256(abi.encode(_request.proofs)),\n            keccak256(encodedBase_)\n        );\n\n        // return\n        return encodedMsg_;\n    }\n\n    /// @dev Encode startup claim milestone request to validate the EIP712 message.\n    /// @param _request StartupClaimRequest struct\n    /// @return EIP712 encoded message containing request\n    function encodeStartupClaim(RequestTypes.StartupClaimRequest memory _request) internal pure returns (bytes memory) {\n        // base\n        bytes memory encodedBase_ = abi.encode(_request.base);\n\n        // msg\n        bytes memory encodedMsg_ = abi.encode(\n            MilestoneConstants.STARTUP_CLAIM_TYPEHASH,\n            keccak256(bytes(_request.raiseId)),\n            keccak256(encodedBase_)\n        );\n\n        // return\n        return encodedMsg_;\n    }\n\n    /// @dev Encode reject raise request to validate the EIP712 message.\n    /// @param _request RejectRaiseRequest struct\n    /// @return EIP712 encoded message containing request\n    function encodeRejectRaise(RequestTypes.RejectRaiseRequest memory _request) internal pure returns (bytes memory) {\n        // base\n        bytes memory encodedBase_ = abi.encode(_request.base);\n\n        // msg\n        bytes memory encodedMsg_ = abi.encode(\n            MilestoneConstants.VOTING_REJECT_RAISE_TYPEHASH,\n            keccak256(bytes(_request.raiseId)),\n            keccak256(encodedBase_)\n        );\n\n        // return\n        return encodedMsg_;\n    }\n\n    /// @dev Encode submit claiming schedule request to validate the EIP 712 message.\n    /// @param _request SubmitClaimingRequest struct\n    /// @return EIP712 encoded message containing request\n    function encodeSubmitClaiming(RequestTypes.SubmitClaimingRequest memory _request) internal pure returns (bytes memory) {\n        // base\n        bytes memory encodedBase_ = abi.encode(_request.base);\n\n        // claiming schedule array\n        bytes memory encodedClaimingSchedules_ = abi.encode(_request.claimingSchedules);\n\n        // msg\n        bytes memory encodedMsg_ = abi.encode(\n            MilestoneConstants.SUBMIT_CLAIMING_TYPEHASH,\n            keccak256(bytes(_request.raiseId)),\n            keccak256(bytes(_request.milestoneId)),\n            keccak256(encodedClaimingSchedules_),\n            keccak256(encodedBase_)\n        );\n\n        // return\n        return encodedMsg_;\n    }\n\n    /// @dev Encode submit claiming schedule receiver request to validate the EIP 712 message.\n    /// @param _request SubmitClaimingRequest struct\n    /// @return EIP712 encoded message containing request\n    function encodeSubmitClaimingReceiver(RequestTypes.SubmitClaimingReceiverRequest memory _request) internal pure returns (bytes memory) {\n        // base\n        bytes memory encodedCrossChainBase_ = abi.encode(_request.crossChainBase);\n\n        // claiming schedule array\n        bytes memory encodedClaimingSchedules_ = abi.encode(_request.claimingSchedules);\n\n        // msg\n        bytes memory encodedMsg_ = abi.encode(\n            MilestoneConstants.SUBMIT_CLAIMING_RECEIVER_TYPEHASH,\n            keccak256(bytes(_request.raiseId)),\n            keccak256(bytes(_request.milestoneId)),\n            keccak256(encodedClaimingSchedules_),\n            keccak256(encodedCrossChainBase_)\n        );\n\n        // return\n        return encodedMsg_;\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/events/MilestoneEvents.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\nimport { StorageTypes } from \"../structs/StorageTypes.sol\";\n\n/**************************************\n\n    Milestone events\n\n**************************************/\n\n/// @notice All events connected with milestones.\nlibrary MilestoneEvents {\n    // -----------------------------------------------------------------------\n    //                              Unlock of milestone\n    // -----------------------------------------------------------------------\n\n    event MilestoneUnlocked(string raiseId, StorageTypes.Milestone milestone);\n    event MilestoneUnlocked__StartupClaimed(string raiseId, address startup, uint256 claimed);\n    event MilestoneUnlocked__InvestorClaimed(string raiseId, address erc20, address investor, uint256 claimed);\n\n    // -----------------------------------------------------------------------\n    //                              Failed repair plan\n    // -----------------------------------------------------------------------\n\n    event RaiseRejected(string raiseId, uint256 rejectedShares);\n    event RaiseRejected__StartupClaimed(string raiseId, address erc20, address startup, uint256 claimed);\n    event RaiseRejected__InvestorClaimed(string raiseId, address investor, uint256 claimed);\n\n    // -----------------------------------------------------------------------\n    //                              Claimings\n    // -----------------------------------------------------------------------\n\n    event ClaimingScheduleSubmitted(string raiseId, string milestoneId, StorageTypes.ClaimingSchedule[] claimingSchedules);\n}\n"
      },
      "src/fundraising/contracts/fundraising/errors/MilestoneErrors.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n/**************************************\n\n    Milestone errors\n\n**************************************/\n\n/// All errors connected with milestone.\nlibrary MilestoneErrors {\n    // -----------------------------------------------------------------------\n    //                              Unlock\n    // -----------------------------------------------------------------------\n\n    error InvalidMilestoneNumber(uint256 milestoneNo, uint256 milestoneCount); // 0x14dc2b26\n    error ZeroShare(uint256 milestoneNo); // 0xef647f82\n    error ShareExceedLimit(uint256 share, uint256 existing); // 0x17e013d5\n\n    // -----------------------------------------------------------------------\n    //                              Claim\n    // -----------------------------------------------------------------------\n\n    error TokenNotOnEscrow(string raiseId); // 0x35880bf8\n    error NothingToClaim(string raiseId, address account); // 0xf5709e8a\n\n    // -----------------------------------------------------------------------\n    //                              Failed repair plan\n    // -----------------------------------------------------------------------\n\n    error RaiseAlreadyRejected(string raiseId, uint256 rejected); // 0xcb1dc2af\n    error AllMilestonesUnlocked(string raiseId, uint256 unlocked); // 0x731a1b87\n\n    // -----------------------------------------------------------------------\n    //                              Claim (repair plan)\n    // -----------------------------------------------------------------------\n\n    error RaiseNotRejected(string raiseId); // 0x4e9e01f8\n\n    // -----------------------------------------------------------------------\n    //                      Submit claiming schedule\n    // -----------------------------------------------------------------------\n\n    error MilestoneNotExists(string milestoneId); // 0x269afc46\n    error ClaimingScheduleAlreadyExists(string claimingScheduleId); // 0xe8616ede\n    error UnlockedShareLimitExceeded(string milestoneId); // 0xf877f9b6\n    error SharesAlreadySubmitted(string milestoneId); // 0x8e7ee80d\n    error SubmittedSharesMustEqualMilestoneShare(string milestoneId, uint256 milestoneShare, uint256 submittedShares); // 0x2c64027e\n}\n"
      },
      "src/fundraising/contracts/fundraising/structs/RequestTypes.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports\nimport { CrossChainRequestTypes } from \"./CrossChainRequestTypes.sol\";\nimport { StorageTypes } from \"./StorageTypes.sol\";\n\n/// @notice Library that defines requests sent from frontend to smart contracts.\nlibrary RequestTypes {\n    // -----------------------------------------------------------------------\n    //                              Base\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct defining low level data for any request.\n    /// @param sender Address of account executing tx\n    /// @param expiry Deadline on which request expires\n    /// @param nonce Number used only once used to prevent tx reply or out of order execution\n    struct BaseRequest {\n        address sender;\n        uint256 expiry;\n        uint256 nonce;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Raise\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct used to create a raise.\n    /// @param raise Struct containing info about raise\n    /// @param raiseDetails Mapping of raise id to vested token information\n    /// @param erc20Asset Struct containing info about vested ERC20\n    /// @param baseAsset Struct containing info about asset used for investment\n    /// @param badgeUri IPFS URI that initializes equity badge for the raise\n    /// @param base Struct defining low level data for a request\n    struct CreateRaiseRequest {\n        StorageTypes.Raise raise;\n        StorageTypes.RaiseDetails raiseDetails;\n        StorageTypes.ERC20Asset erc20Asset;\n        StorageTypes.BaseAsset baseAsset;\n        string badgeUri;\n        BaseRequest base;\n    }\n\n    /// @dev Struct used to create a raise.\n    /// @param raise Struct containing info about raise\n    /// @param raiseDetails Mapping of raise id to vested token information\n    /// @param erc20Asset Struct containing info about vested ERC20\n    /// @param baseAsset Struct containing info about asset used for investment\n    /// @param crossChainBase Struct defining low level data for a cross-chain requests\n    struct RegisterRaiseRequest {\n        StorageTypes.Raise raise;\n        StorageTypes.RaiseDetails raiseDetails;\n        StorageTypes.ERC20Asset erc20Asset;\n        StorageTypes.BaseAsset baseAsset;\n        CrossChainRequestTypes.CrossChainBase crossChainBase;\n    }\n\n    /// @dev Struct Used to finish a raise.\n    /// @param raiseId Id of finished raise\n    /// @param raised Number of collected tokens\n    /// @param merkleRoot Root value of merkle tree build from investments\n    /// @param base Struct defining low level data for a request\n    struct FinishRaiseRequest {\n        string raiseId;\n        uint256 raised;\n        bytes32 merkleRoot;\n        BaseRequest base;\n    }\n\n    /// @dev Struct used to finish a raise in receiver\n    /// @param raiseId Id of finished raise\n    /// @param raised Number of collected tokens\n    /// @param merkleRoot Root value of merkle tree build from investments\n    /// @param crossChainBase Struct defining low level data for a cross-chain requests\n    struct FinishRaiseReceiverRequest {\n        string raiseId;\n        uint256 raised;\n        bytes32 merkleRoot;\n        CrossChainRequestTypes.CrossChainBase crossChainBase;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Set token\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct used to set a token for an early stage raise.\n    /// @param raiseId UUID of raise\n    /// @param token Address of ERC20\n    /// @param base Struct defining low level data for a request\n    struct SetTokenRequest {\n        string raiseId;\n        address token;\n        BaseRequest base;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Invest\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct used to invest into raise.\n    /// @param raiseId UUID of raise\n    /// @param investment Amount of base asset used to invest\n    /// @param maxTicketSize Individual limit of investment for validation\n    /// @param base Struct defining low level data for a request\n    struct InvestRequest {\n        string raiseId;\n        uint256 investment;\n        uint256 maxTicketSize;\n        BaseRequest base;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Voting\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct used to unlock milestone\n    /// @param raiseId UUID of raise\n    /// @param milestone Struct containing info about unlocked milestone\n    /// @param base Struct defining low level data for a request\n    struct UnlockMilestoneRequest {\n        string raiseId;\n        StorageTypes.Milestone milestone;\n        BaseRequest base;\n    }\n\n    /// @dev Struct used to unlock milestone\n    /// @param raiseId UUID of raise\n    /// @param milestone Struct containing info about unlocked milestone\n    /// @param crossChainBase Struct defining low level data for a cross-chain requests\n    struct UnlockMilestoneReceiverRequest {\n        string raiseId;\n        StorageTypes.Milestone milestone;\n        CrossChainRequestTypes.CrossChainBase crossChainBase;\n    }\n\n    /// @dev Struct used to submit failed repair plan\n    /// @param raiseId UUID of raise\n    /// @param base Struct defining low level data for a request\n    struct RejectRaiseRequest {\n        string raiseId;\n        BaseRequest base;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Claiming\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct used to submit claiming schedule\n    /// @param raiseId UUID of raise\n    /// @param milestoneId UUID of milestone\n    /// @param claimingSchedules Array of ClaimingSchedule structs\n    /// @param base Struct defining low level data for a request\n    struct SubmitClaimingRequest {\n        string raiseId;\n        string milestoneId;\n        StorageTypes.ClaimingSchedule[] claimingSchedules;\n        BaseRequest base;\n    }\n\n    /// @dev Struct used to submit claiming schedule\n    /// @param raiseId UUID of raise\n    /// @param milestoneId UUID of milestone\n    /// @param claimingSchedules Array of ClaimingSchedule structs\n    /// @param crossChainBase Struct defining low level data for a cross-chain requests\n    struct SubmitClaimingReceiverRequest {\n        string raiseId;\n        string milestoneId;\n        StorageTypes.ClaimingSchedule[] claimingSchedules;\n        CrossChainRequestTypes.CrossChainBase crossChainBase;\n    }\n\n    /// @dev Struct used to claim tokens by investor\n    /// @param raiseId UUID of raise\n    /// @param investment Investment of msg.sender\n    /// @param proofs Merkle proofs for msg.sender\n    /// @param base Struct defining low level data for a request\n    struct InvestorClaimRequest {\n        string raiseId;\n        uint256 investment;\n        bytes32[] proofs;\n        BaseRequest base;\n    }\n\n    /// @dev Struct used to claim tokens by startup\n    /// @param raiseId UUID of raise\n    /// @param base Struct defining low level data for a request\n    struct StartupClaimRequest {\n        string raiseId;\n        BaseRequest base;\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/storage/assets/LibERC20Asset.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports - Structs\nimport { StorageTypes } from \"../../../structs/StorageTypes.sol\";\n\n/// @dev Library containing ERC-20 asset storage with getters and setters\nlibrary LibERC20Asset {\n    // -----------------------------------------------------------------------\n    //                              Constants\n    // -----------------------------------------------------------------------\n\n    /// @dev ERC-20 asset storage pointer.\n    bytes32 internal constant ERC20_ASSET_STORAGE_POSITION = keccak256(\"angelblock.fundraising.erc20\");\n\n    // -----------------------------------------------------------------------\n    //                              Structs\n    // -----------------------------------------------------------------------\n\n    /// @dev ERC-20 asset storage struct.\n    /// @param erc20 Mapping of raise id to ERC-20 asset struct\n    struct ERC20AssetStorage {\n        mapping(string => StorageTypes.ERC20Asset) erc20;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Diamond storage\n    // -----------------------------------------------------------------------\n\n    /// @dev Function returning ERC-20 asset storage at storage pointer slot.\n    /// @return eas ERC20AssetStorage struct instance at storage pointer position\n    function erc20AssetStorage() internal pure returns (ERC20AssetStorage storage eas) {\n        // declare position\n        bytes32 position = ERC20_ASSET_STORAGE_POSITION;\n\n        // set slot to position\n        assembly {\n            eas.slot := position\n        }\n\n        // explicit return\n        return eas;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Getters / setters\n    // -----------------------------------------------------------------------\n\n    /// @dev Diamond storage getter: ERC-20 asset address.\n    /// @param _raiseId ID of the raise\n    /// @return Address of the ERC-20 asset\n    function getAddress(string memory _raiseId) internal view returns (address) {\n        return erc20AssetStorage().erc20[_raiseId].erc20;\n    }\n\n    /// @dev Diamond storage getter: ERC-20 asset chain id.\n    /// @param _raiseId ID of the raise\n    /// @return Id of the chain\n    function getChainId(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return erc20AssetStorage().erc20[_raiseId].chainId;\n    }\n\n    /// @dev Diamond storage getter: ERC-20 asset vested amount.\n    /// @param _raiseId ID of the raise\n    /// @return Amount of vested ERC-20 tokens\n    function getAmount(string memory _raiseId) internal view returns (uint256) {\n        return erc20AssetStorage().erc20[_raiseId].amount;\n    }\n\n    /// @dev Diamond storage setter: ERC-20 asset\n    /// @param _raiseId ID of the raise\n    /// @param _erc20Asset StorageTypes.ERC20Asset struct\n    function setERC20Asset(string memory _raiseId, StorageTypes.ERC20Asset memory _erc20Asset) internal {\n        erc20AssetStorage().erc20[_raiseId] = _erc20Asset;\n    }\n\n    /// @dev Diamond storage setter: ERC-20 asset address.\n    /// @param _raiseId ID of the raise\n    /// @param _erc20 Address of the ERC-20 asset\n    function setERC20Address(string memory _raiseId, address _erc20) internal {\n        erc20AssetStorage().erc20[_raiseId].erc20 = _erc20;\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/storage/assets/LibEscrow.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n/// @notice Library containing Escrow storage with getters and setters.\nlibrary LibEscrow {\n    // -----------------------------------------------------------------------\n    //                              Constants\n    // -----------------------------------------------------------------------\n\n    /// @dev Escrow storage pointer.\n    bytes32 internal constant ESCROW_STORAGE_POSITION = keccak256(\"angelblock.fundraising.escrow\");\n\n    // -----------------------------------------------------------------------\n    //                              Structs\n    // -----------------------------------------------------------------------\n\n    /// @dev Escrow diamond storage.\n    /// @param source Address of contract with source implementation for cloning Escrows.\n    /// @param escrows Mapping of raise id to cloned Escrow instance address.\n    struct EscrowStorage {\n        address source;\n        mapping(string => address) escrows;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Diamond storage\n    // -----------------------------------------------------------------------\n\n    /// @dev Function returning escrow storage at storage pointer slot.\n    /// @return es EscrowStorage struct instance at storage pointer position\n    function escrowStorage() internal pure returns (EscrowStorage storage es) {\n        // declare position\n        bytes32 position = ESCROW_STORAGE_POSITION;\n\n        // set slot to position\n        assembly {\n            es.slot := position\n        }\n\n        // explicit return\n        return es;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Getters / setters\n    // -----------------------------------------------------------------------\n\n    /// @dev Diamond storage getter: Escrow source address.\n    /// @return Escrow source address.\n    function getSource() internal view returns (address) {\n        return escrowStorage().source;\n    }\n\n    /// @dev Diamond storage getter: Escrow address.\n    /// @param _raiseId Id of the Raise.\n    /// @return Escrow address.\n    function getEscrow(string memory _raiseId) internal view returns (address) {\n        // get escrow address\n        return escrowStorage().escrows[_raiseId];\n    }\n\n    /// @dev Diamond storage setter: Escrow source.\n    /// @param _source Address of the source\n    function setSource(address _source) internal {\n        // set source address\n        escrowStorage().source = _source;\n    }\n\n    /// @dev Diamond storage setter: Escrow address for raise.\n    /// @param _raiseId Id of the Raise.\n    /// @param _escrow Address of the escrow\n    function setEscrow(string memory _raiseId, address _escrow) internal {\n        // set Escrow\n        escrowStorage().escrows[_raiseId] = _escrow;\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/storage/milestone/LibMilestone.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// OpenZeppelin imports\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n// Local imports\nimport { LibBaseAsset } from \"../assets/LibBaseAsset.sol\";\nimport { StorageTypes } from \"../../../structs/StorageTypes.sol\";\nimport { IEscrow } from \"../../../interfaces/IEscrow.sol\";\n\n/**************************************\n\n    Milestone library\n\n    ------------------------------\n\n    Diamond storage containing milestone data\n\n **************************************/\n\n/// @notice Library containing MilestoneStorage and low level functions.\nlibrary LibMilestone {\n    // -----------------------------------------------------------------------\n    //                              Library usage\n    // -----------------------------------------------------------------------\n\n    using SafeERC20 for IERC20;\n\n    // -----------------------------------------------------------------------\n    //                              Constants\n    // -----------------------------------------------------------------------\n\n    /// @dev Milestone storage pointer.\n    bytes32 internal constant MILESTONE_STORAGE_POSITION = keccak256(\"angelblock.fundraising.milestone\");\n    /// @dev Precision for share calculation.\n    uint256 internal constant SHARE_PRECISION = 1_000_000;\n\n    // -----------------------------------------------------------------------\n    //                              Structs\n    // -----------------------------------------------------------------------\n\n    /// @dev Milestone storage struct.\n    /// @param shares Mapping of raise id to struct containing share data\n    /// @param votingClaiming Mapping of raise id to struct used to track claims after unlocked milestone\n    /// @param repairPlanClaiming Mapping of raise id to struct used to track claims after failed repair plan\n    struct MilestoneStorage {\n        mapping(string => StorageTypes.ShareInfo) shares;\n        mapping(string => StorageTypes.ClaimingInfo) votingClaiming;\n        mapping(string => StorageTypes.ClaimingInfo) repairPlanClaiming;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Diamond storage\n    // -----------------------------------------------------------------------\n\n    /// @dev Function returning milestone storage at storage pointer slot.\n    /// @return ms MilestoneStorage struct instance at storage pointer position\n    function milestoneStorage() internal pure returns (MilestoneStorage storage ms) {\n        // declare position\n        bytes32 position = MILESTONE_STORAGE_POSITION;\n\n        // set slot to position\n        assembly {\n            ms.slot := position\n        }\n\n        // explicit return\n        return ms;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Getters / Setters\n    // -----------------------------------------------------------------------\n\n    /// @dev Diamond storage getter: milestones->length.\n    /// @param _raiseId ID of raise\n    /// @return Length of milestones\n    function milestoneCount(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return milestoneStorage().shares[_raiseId].milestones.length;\n    }\n\n    /// @dev Diamond storage extensions function: verify if milestone exists\n    /// @param _raiseId ID of raise\n    /// @param _milestoneId ID of milestone\n    /// @return Struct with given params : 1. Is milestone exists, 2. Index of the milestone in the storage array\n    function milestoneExists(string memory _raiseId, string memory _milestoneId) internal view returns (bool, uint256) {\n        // Fetch all milestone for given raise id from the storage\n        StorageTypes.Milestone[] memory milestones_ = milestoneStorage().shares[_raiseId].milestones;\n\n        // check all milestone in the storage\n        for (uint i = 0; i < milestones_.length; i++) {\n            string memory storageMilestoneId_ = milestones_[i].milestoneId;\n\n            // verify milestone ids\n            if (keccak256(abi.encodePacked(storageMilestoneId_)) == keccak256(abi.encodePacked(_milestoneId))) {\n                // return when milestone exists\n                return (true, i);\n            }\n        }\n\n        // return when milestone not exists\n        return (false, 0);\n    }\n\n    /// @dev Diamond storage getter: milestone\n    /// @param _raiseId ID of raise\n    /// @param _milestoneIndex Index of the milestone in the storage array\n    /// @return Milestone struct\n    function getMilestone(string memory _raiseId, uint256 _milestoneIndex) internal view returns (StorageTypes.Milestone memory) {\n        return milestoneStorage().shares[_raiseId].milestones[_milestoneIndex];\n    }\n\n    /// @dev Diamond storage getter: milestone->id\n    /// @param _raiseId ID of raise\n    /// @param _milestoneIndex Index of the milestone in the storage array\n    /// @return Id of the milestone\n    function getMilestoneId(string memory _raiseId, uint256 _milestoneIndex) internal view returns (string memory) {\n        return milestoneStorage().shares[_raiseId].milestones[_milestoneIndex].milestoneId;\n    }\n\n    /// @dev Diamond storage getter: milestone->share\n    /// @param _raiseId ID of raise\n    /// @param _milestoneIndex Index of the milestone in the storage array\n    /// @return Share of the milestone\n    function getMilestoneShare(string memory _raiseId, uint256 _milestoneIndex) internal view returns (uint256) {\n        return milestoneStorage().shares[_raiseId].milestones[_milestoneIndex].share;\n    }\n\n    /// @dev Diamond storage getter: milestones->share->sum.\n    /// @param _raiseId ID of raise\n    /// @return Sum of milestone shares (successful voting)\n    function unlockedShares(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return milestoneStorage().shares[_raiseId].unlockedShares;\n    }\n\n    /// @dev Diamond storage getter: milestones->rejected->sum.\n    /// @param _raiseId ID of raise\n    /// @return Sum of rejected shares (failed repair plan)\n    function rejectedShares(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return milestoneStorage().shares[_raiseId].rejectedShares;\n    }\n\n    /// @dev Diamond storage getter: milestones->share+rejected->sum.\n    /// @param _raiseId ID of raise\n    /// @return Sum of unlocked and rejected shares\n    function totalShares(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return milestoneStorage().shares[_raiseId].totalShares;\n    }\n\n    /// @dev Diamond storage getter: investor claimed.\n    /// @param _raiseId ID of raise\n    /// @param _account Address of investor\n    /// @return Claimed tokens by investor\n    function getInvestorClaimedVoting(string memory _raiseId, address _account) internal view returns (uint256) {\n        // return\n        return milestoneStorage().votingClaiming[_raiseId].investorClaimed[_account];\n    }\n\n    /// @dev Diamond storage getter: startup claimed.\n    /// @param _raiseId ID of raise\n    /// @return Claimed base assets by investor\n    function getStartupClaimedVoting(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return milestoneStorage().votingClaiming[_raiseId].startupClaimed;\n    }\n\n    /// @dev Diamond storage getter: investor claimed.\n    /// @param _raiseId ID of raise\n    /// @param _account Address of investor\n    /// @return Claimed tokens by investor\n    function getInvestorClaimedRejected(string memory _raiseId, address _account) internal view returns (uint256) {\n        // return\n        return milestoneStorage().repairPlanClaiming[_raiseId].investorClaimed[_account];\n    }\n\n    /// @dev Diamond storage getter: startup claimed.\n    /// @param _raiseId ID of raise\n    /// @return Claimed base assets by investor\n    function getStartupClaimedRejected(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return milestoneStorage().repairPlanClaiming[_raiseId].startupClaimed;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Unlock\n    // -----------------------------------------------------------------------\n\n    /// @dev Unlock new milestone for raise.\n    /// @param _raiseId ID of raise\n    /// @param _milestone Milestone struct\n    function unlockMilestone(string memory _raiseId, StorageTypes.Milestone memory _milestone) internal {\n        // get shares\n        StorageTypes.ShareInfo storage shares_ = milestoneStorage().shares[_raiseId];\n\n        // register new unlocked milestone\n        shares_.milestones.push(_milestone);\n\n        // increase unlocked shares\n        shares_.unlockedShares += _milestone.share;\n\n        // increase total shares\n        shares_.totalShares += _milestone.share;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Claim\n    // -----------------------------------------------------------------------\n\n    /// @dev Claim milestone by startup.\n    /// @param _raiseId ID of raise\n    /// @param _escrow Address of escrow\n    /// @param _recipient Address of startup\n    /// @param _amount Tokens to claim\n    function claimMilestoneStartup(string memory _raiseId, address _escrow, address _recipient, uint256 _amount) internal {\n        // storage update\n        milestoneStorage().votingClaiming[_raiseId].startupClaimed += _amount;\n\n        // transfer USDT\n        IEscrow(_escrow).withdraw(LibBaseAsset.getAddress(_raiseId), IEscrow.ReceiverData(_recipient, _amount));\n    }\n\n    /// @dev Claim milestone by investor.\n    /// @param _raiseId ID of raise\n    /// @param _erc20 Address of token to claim\n    /// @param _escrow Address of escrow\n    /// @param _recipient Address of investor\n    /// @param _amount Tokens to claim\n    function claimMilestoneInvestor(string memory _raiseId, address _erc20, address _escrow, address _recipient, uint256 _amount) internal {\n        // storage update\n        milestoneStorage().votingClaiming[_raiseId].investorClaimed[_recipient] += _amount;\n\n        // transfer ERC20\n        IEscrow(_escrow).withdraw(_erc20, IEscrow.ReceiverData(_recipient, _amount));\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Reject raise\n    // -----------------------------------------------------------------------\n\n    /// @dev Reject raise to revert the rest of locked shares.\n    /// @param _raiseId ID of raise\n    /// @return Amount of rejected shares\n    function rejectRaise(string memory _raiseId) internal returns (uint256) {\n        // get existing unlocked and rejected shares\n        uint256 existing_ = totalShares(_raiseId);\n\n        // calculate still locked shares\n        uint256 remaining_ = 100 * SHARE_PRECISION - existing_;\n\n        // set rejected shares\n        milestoneStorage().shares[_raiseId].rejectedShares += remaining_;\n\n        // set total shares\n        milestoneStorage().shares[_raiseId].totalShares += remaining_;\n\n        // return\n        return remaining_;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Claim (failed repair plan)\n    // -----------------------------------------------------------------------\n\n    /// @dev Claim rejected repair plan funds by startup.\n    /// @param _raiseId ID of raise\n    /// @param _erc20 Address of token to claim\n    /// @param _escrow Address of escrow\n    /// @param _recipient Address of startup\n    /// @param _amount Tokens to claim\n    function claimRejectedStartup(string memory _raiseId, address _erc20, address _escrow, address _recipient, uint256 _amount) internal {\n        // storage update\n        milestoneStorage().repairPlanClaiming[_raiseId].startupClaimed += _amount;\n\n        // transfer ERC20\n        IEscrow(_escrow).withdraw(_erc20, IEscrow.ReceiverData(_recipient, _amount));\n    }\n\n    /// @dev Claim rejected repair plan funds by investor.\n    /// @param _raiseId ID of raise\n    /// @param _escrow Address of escrow\n    /// @param _recipient Address of investor\n    /// @param _amount Tokens to claim\n    function claimRejectedInvestor(string memory _raiseId, address _escrow, address _recipient, uint256 _amount) internal {\n        // storage update\n        milestoneStorage().repairPlanClaiming[_raiseId].investorClaimed[_recipient] += _amount;\n\n        // transfer USDT\n        IEscrow(_escrow).withdraw(LibBaseAsset.getAddress(_raiseId), IEscrow.ReceiverData(_recipient, _amount));\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/services/milestone/InvestorClaimMilestoneService.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports - constants, encoders, events, errors, structs\nimport { RequestErrors } from \"../../../errors/RequestErrors.sol\";\nimport { CrossChainErrors } from \"../../../errors/cross-chain/CrossChainErrors.sol\";\nimport { EnumTypes } from \"../../../structs/EnumTypes.sol\";\nimport { LibERC20Asset } from \"../../storage/assets/LibERC20Asset.sol\";\n\n// Local imports - storages\nimport { LibRaise } from \"../../storage/raise/LibRaise.sol\";\nimport { LibMilestone } from \"../../storage/milestone/LibMilestone.sol\";\nimport { LibClaimingSchedule } from \"../../storage/milestone/LibClaimingSchedule.sol\";\n\n// Local imports - services\nimport { ERC20AssetService } from \"../assets/internal/ERC20AssetService.sol\";\nimport { RaiseService } from \"../raise/internal/RaiseService.sol\";\nimport { InvestorClaimService } from \"./internal/InvestorClaimService.sol\";\n\n/// @notice Service for investor claim milestone\nlibrary InvestorClaimMilestoneService {\n    /// @dev Validate claim milestone by investor request.\n    /// @dev Validation: Requires raise that is finished and has reached softcap.\n    /// @dev Validation: Can be only called by user that invested in raise.\n    /// @param _raiseId ID of raise\n    /// @param _recipient Address of investor\n    /// @param _investment Investment of investor\n    /// @param _proofs Merkle proofs for user and investment\n    function validateClaimMilestoneInvestor(\n        string memory _raiseId,\n        address _recipient,\n        uint256 _investment,\n        bytes32[] memory _proofs\n    ) internal view {\n        // validate if erc20 asset is on the current chain\n        uint256 erc20ChainId_ = LibERC20Asset.getChainId(_raiseId);\n        if (erc20ChainId_ != block.chainid) {\n            revert CrossChainErrors.InvalidChainId(block.chainid, erc20ChainId_);\n        }\n\n        // validate merkle proofs\n        (bool validMerkle_, bytes32 root_, bytes32 leaf_) = InvestorClaimService.verifyProofs(_raiseId, _recipient, _investment, _proofs);\n        if (!validMerkle_) {\n            revert RequestErrors.InvalidMerkleProofs(_raiseId, _recipient, _investment, _proofs, root_, leaf_);\n        }\n\n        // check if erc20 is set and deposited for claiming\n        if (LibRaise.getType(_raiseId) == EnumTypes.RaiseType.EarlyStage) {\n            ERC20AssetService.validateEarlyStageERC20(_raiseId);\n        }\n    }\n\n    /// @dev Return available ERC20 to claim for investor\n    function getAvailableForInvestor(string memory _raiseId, address _account, uint256 investment_) internal view returns (uint256) {\n        // get raised\n        uint256 total_ = LibRaise.getRaised(_raiseId);\n\n        // compute share\n        uint256 share_ = (investment_ * LibMilestone.SHARE_PRECISION) / total_;\n\n        // get all tokens for investor\n        uint256 userDebt_ = (share_ * RaiseService.getSold(_raiseId)) / LibMilestone.SHARE_PRECISION;\n\n        // compute claimable\n        uint256 claimable_ = (getUnlockedShares(_raiseId) * userDebt_) / (100 * LibMilestone.SHARE_PRECISION);\n\n        // get claimed\n        uint256 claimed_ = LibMilestone.getInvestorClaimedVoting(_raiseId, _account);\n\n        // return available\n        return claimable_ - claimed_;\n    }\n\n    /// @dev Calculate available to claim shares\n    function getUnlockedShares(string memory _raiseId) internal view returns (uint256 unlockedShares_) {\n        // get milestones length for given raise is\n        uint256 milestonesCount_ = LibMilestone.milestoneCount(_raiseId);\n\n        // iterate over milestones\n        for (uint i = 0; i < milestonesCount_; i++) {\n            // get milestone id\n            string memory milestoneId_ = LibMilestone.getMilestoneId(_raiseId, i);\n\n            // get all claiming schedule ids for given milestone\n            string[] memory milestoneClaimingScheduleIds_ = LibClaimingSchedule.getClaimingScheduleIds(milestoneId_);\n\n            // get length for claiming schedule ids\n            uint256 claimingSchedulesCount_ = milestoneClaimingScheduleIds_.length;\n\n            // iterate over schedules\n            for (uint j = 0; j < claimingSchedulesCount_; j++) {\n                // get claiming schedule unlock timestamp\n                uint256 unlockTimestamp_ = LibClaimingSchedule.getUnlockTimestamp(milestoneId_, milestoneClaimingScheduleIds_[j]);\n\n                // check if claiming schedule is unlocked\n                if (unlockTimestamp_ <= block.timestamp) {\n                    // increase unlocked shares by claiming schedule partial share\n                    unlockedShares_ += LibClaimingSchedule.getPartialShare(milestoneId_, milestoneClaimingScheduleIds_[j]);\n                }\n            }\n        }\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/services/milestone/internal/InvestorClaimService.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// OpenZeppelin imports\nimport { MerkleProof } from \"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol\";\n\n// Local imports - storages\nimport { LibRaise } from \"../../../storage/raise/LibRaise.sol\";\n\n/// @notice Internal service for investor claiming\nlibrary InvestorClaimService {\n    function verifyProofs(\n        string memory _raiseId,\n        address _recipient,\n        uint256 _investment,\n        bytes32[] memory _proofs\n    ) internal view returns (bool, bytes32, bytes32) {\n        // retrieve merkle root\n        bytes32 root_ = LibRaise.getMerkleRoot(_raiseId);\n\n        // compute leaf\n        bytes32 leaf_ = keccak256(bytes.concat(keccak256(abi.encode(_recipient, _investment))));\n\n        // verify proofs\n        bool valid_ = MerkleProof.verify(_proofs, root_, leaf_);\n\n        // return\n        return (valid_, root_, leaf_);\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/services/utils/RequestService.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports - constants, encoders, events, errors, structs\nimport { RequestErrors } from \"../../../errors/RequestErrors.sol\";\nimport { RequestTypes } from \"../../../structs/RequestTypes.sol\";\nimport { CrossChainRequestTypes } from \"../../../structs/CrossChainRequestTypes.sol\";\n\n// Local imports - storages\nimport { LibNonce } from \"../../../libraries/storage/utils/LibNonce.sol\";\n\nlibrary RequestService {\n    function validateBaseRequest(RequestTypes.BaseRequest memory _baseRequest) internal view {\n        // tx.members\n        address sender_ = msg.sender;\n        uint256 now_ = block.timestamp;\n\n        // check replay attack\n        uint256 nonce_ = _baseRequest.nonce;\n        if (nonce_ <= LibNonce.getLastNonce(sender_)) {\n            revert RequestErrors.NonceExpired(sender_, nonce_);\n        }\n\n        // check request expiration\n        if (now_ > _baseRequest.expiry) {\n            revert RequestErrors.RequestExpired(sender_, _baseRequest.expiry);\n        }\n\n        // check request sender\n        if (sender_ != _baseRequest.sender) {\n            revert RequestErrors.IncorrectSender(sender_);\n        }\n    }\n\n    function validateCcBaseRequest(CrossChainRequestTypes.CrossChainBase memory _baseRequest) internal view {\n        if (_baseRequest.nonce <= LibNonce.getLastNonce(_baseRequest.sender)) {\n            revert RequestErrors.NonceExpired(_baseRequest.sender, _baseRequest.nonce);\n        }\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/services/utils/SignatureService.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// OpenZeppelin imports\nimport { ECDSA } from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n\n// Local imports - constants, encoders, events, errors, structs\nimport { SignatureConstants } from \"../../../constants/SignatureConstants.sol\";\nimport { SignatureErrors } from \"../../../errors/SignatureErrors.sol\";\nimport { AccessTypes } from \"../../../structs/AccessTypes.sol\";\n\n// Local imports - storages\nimport { LibAccessControl } from \"../../storage/utils/LibAccessControl.sol\";\n\nlibrary SignatureService {\n    // const\n    bytes32 internal constant EIP712_DOMAIN_TYPEHASH =\n        keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n    /// @dev Verify if given signature is signed by correct signer.\n    /// @param _message Hash message\n    /// @param _v Part of signature for message\n    /// @param _r Part of signature for message\n    /// @param _s Part of signature for message\n    function verifySignature(bytes32 _message, uint8 _v, bytes32 _r, bytes32 _s) internal view {\n        // signer of message\n        address signer_ = recoverSigner(_message, _v, _r, _s);\n\n        // validate signer\n        if (!LibAccessControl.hasRole(AccessTypes.SIGNER_ROLE, signer_)) {\n            revert SignatureErrors.IncorrectSigner(signer_);\n        }\n    }\n\n    /// @dev Verify EIP-712 message sent.\n    /// @param _nameHash Hash EIP-712 name\n    /// @param _versionHash Hash EIP-712 version\n    /// @param _rawMessage Hash message calculated \"on-the-fly\"\n    /// @param _message Message sent in request\n    function verifyMessage(bytes32 _nameHash, bytes32 _versionHash, bytes32 _rawMessage, bytes32 _message) internal view {\n        // build domain separator\n        bytes32 domainSeparatorV4_ = keccak256(\n            abi.encode(SignatureConstants.EIP712_DOMAIN_TYPEHASH, _nameHash, _versionHash, block.chainid, address(this))\n        );\n\n        // construct EIP712 message\n        bytes32 toVerify_ = ECDSA.toTypedDataHash(domainSeparatorV4_, _rawMessage);\n\n        // verify computation against original\n        if (toVerify_ != _message) {\n            revert SignatureErrors.InvalidMessage(toVerify_, _message);\n        }\n    }\n\n    function hashToMessage(bytes32 _nameHash, bytes32 _versionHash, bytes32 _rawMessage) internal view returns (bytes32) {\n        // return\n        return hashToMessage(_nameHash, _versionHash, _rawMessage, address(this));\n    }\n\n    function hashToMessage(\n        bytes32 _nameHash,\n        bytes32 _versionHash,\n        bytes32 _rawMessage,\n        address _contractAddress\n    ) internal view returns (bytes32) {\n        // build domain separator\n        bytes32 domainSeparatorV4_ = keccak256(abi.encode(EIP712_DOMAIN_TYPEHASH, _nameHash, _versionHash, block.chainid, _contractAddress));\n\n        // construct EIP712 message\n        return ECDSA.toTypedDataHash(domainSeparatorV4_, _rawMessage);\n    }\n\n    /// @dev Allows to return signer of the signature.\n    /// @param _data Message sent in request\n    /// @param _v Part of signature for message\n    /// @param _r Part of signature for message\n    /// @param _s Part of signature for message\n    /// @return Signer of the message\n    function recoverSigner(bytes32 _data, uint8 _v, bytes32 _r, bytes32 _s) internal pure returns (address) {\n        // recover EIP712 signer using provided vrs\n        address signer_ = ECDSA.recover(_data, _v, _r, _s);\n\n        // return signer\n        return signer_;\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/services/raise/internal/RaiseService.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports - constants, encoders, events, errors, structs\nimport { RequestErrors } from \"../../../../errors/RequestErrors.sol\";\nimport { RaiseErrors } from \"../../../../errors/RaiseErrors.sol\";\nimport { CrossChainErrors } from \"../../../../errors/cross-chain/CrossChainErrors.sol\";\nimport { StorageTypes } from \"../../../../structs/StorageTypes.sol\";\nimport { EnumTypes } from \"../../../../structs/EnumTypes.sol\";\n\n// Local imports - storages\nimport { LibRaise } from \"../../../storage/raise/LibRaise.sol\";\nimport { LibERC20Asset } from \"../../../storage/assets/LibERC20Asset.sol\";\nimport { LibBaseAsset } from \"../../../storage/assets/LibBaseAsset.sol\";\nimport { LibNonce } from \"../../../storage/utils/LibNonce.sol\";\n\nlibrary RaiseService {\n    /**************************************\n\n        Create raise\n\n     **************************************/\n\n    /// @dev Set to storage all raise and assets data.\n    /// @param _raiseId ID of the raise\n    /// @param _sender Message sender\n    /// @param _nonce Used nonce\n    /// @param _raise StorageTypes.Raise struct\n    /// @param _raiseDetails StorageTypes.RaiseDetails struct\n    /// @param _erc20Asset StorageTypes.ERC20Asset struct\n    /// @param _baseAsset StorageTypes.BaseAsset struct\n    function setRaiseCreationData(\n        string memory _raiseId,\n        address _sender,\n        uint256 _nonce,\n        StorageTypes.Raise memory _raise,\n        StorageTypes.RaiseDetails memory _raiseDetails,\n        StorageTypes.ERC20Asset memory _erc20Asset,\n        StorageTypes.BaseAsset memory _baseAsset\n    ) internal {\n        // set raise to storage\n        LibRaise.setRaise(_raiseId, _raise);\n        // set raise details to storage\n        LibRaise.setRaiseDetails(_raiseId, _raiseDetails);\n        // set ERC-20 asset to storage\n        LibERC20Asset.setERC20Asset(_raiseId, _erc20Asset);\n        // set base asset to storage\n        LibBaseAsset.setBaseAsset(_raiseId, _baseAsset);\n        // set status\n        LibRaise.setRaiseStatus(_raiseId, EnumTypes.RaiseStatus.RaiseCreated);\n        // set nonce as used to storage\n        LibNonce.setNonce(_sender, _nonce);\n    }\n\n    function validateCreationRequest(\n        StorageTypes.Raise memory _raise,\n        StorageTypes.RaiseDetails memory _raiseDetails,\n        StorageTypes.ERC20Asset memory _erc20Asset,\n        address _sender,\n        uint256 _nonce\n    ) internal view {\n        if (_nonce <= LibNonce.getLastNonce(_sender)) {\n            revert RequestErrors.NonceExpired(_sender, _nonce);\n        }\n\n        // check raise id\n        if (bytes(_raise.raiseId).length == 0) {\n            revert RaiseErrors.InvalidRaiseId(_raise.raiseId);\n        }\n\n        // verify if raise does not exist\n        if (isRaiseExists(_raise.raiseId)) {\n            revert RaiseErrors.RaiseAlreadyExists(_raise.raiseId);\n        }\n\n        // check start and end date\n        if (_raiseDetails.start >= _raiseDetails.end) {\n            revert RaiseErrors.InvalidRaiseStartEnd(_raiseDetails.start, _raiseDetails.end);\n        }\n\n        // check if tokens are vested\n        if (_erc20Asset.amount == 0) {\n            revert RaiseErrors.InvalidVestedAmount();\n        }\n\n        // validate price per token == vested / hardcap\n        if (_raiseDetails.tokensPerBaseAsset != (_erc20Asset.amount * LibRaise.PRICE_PRECISION) / _raiseDetails.hardcap) {\n            revert RaiseErrors.PriceNotMatchConfiguration(_raiseDetails.tokensPerBaseAsset, _raiseDetails.hardcap, _erc20Asset.amount);\n        }\n\n        // validate token address for Early Stage type\n        if (_raise.raiseType != EnumTypes.RaiseType.EarlyStage && _erc20Asset.erc20 == address(0)) {\n            revert RaiseErrors.InvalidTokenAddress(_erc20Asset.erc20);\n        }\n    }\n\n    /**************************************\n\n        Finish raise\n\n     **************************************/\n\n    /// @dev Set finish raise\n    /// @param _raiseId ID of the raise\n    /// @param _raised uint256 raised funds\n    /// @param _merkleRoot bytes32 merkle root\n    function setFinishRaiseData(string memory _raiseId, uint256 _raised, bytes32 _merkleRoot) internal {\n        StorageTypes.RaiseDataCC memory raiseDataCC_ = StorageTypes.RaiseDataCC({ raised: _raised, merkleRoot: _merkleRoot });\n        LibRaise.setRaiseDataCrosschain(_raiseId, raiseDataCC_);\n\n        if (isSoftcapAchieved(_raiseId)) {\n            LibRaise.setRaiseStatus(_raiseId, EnumTypes.RaiseStatus.RaiseSucceed);\n        } else {\n            LibRaise.setRaiseStatus(_raiseId, EnumTypes.RaiseStatus.RaiseFailed);\n        }\n    }\n\n    /// @dev Used for both: sender and receiver\n    /// @param _raiseId ID of the raise\n    /// @param _sender Message sender\n    /// @param _nonce Used nonce\n    function validateFinishRaiseRequest(string memory _raiseId, address _sender, uint256 _nonce) internal view {\n        if (_nonce <= LibNonce.getLastNonce(_sender)) {\n            revert RequestErrors.NonceExpired(_sender, _nonce);\n        }\n\n        if (LibRaise.getMerkleRoot(_raiseId) != 0) {\n            revert RaiseErrors.RaiseAlreadyFinished(_raiseId);\n        }\n    }\n\n    /**************************************\n\n        Sold / unsold\n\n     **************************************/\n\n    /// @dev Get amount of sold tokens.\n    /// @param _raiseId ID of raise\n    /// @return Amount of tokens to claim by investor\n    function getSold(string memory _raiseId) internal view returns (uint256) {\n        // get tokens per base asset\n        uint256 tokensPerBaseAsset_ = LibRaise.getTokensPerBaseAsset(_raiseId);\n\n        // get raised\n        uint256 raised_ = LibRaise.getRaised(_raiseId);\n\n        // calculate how much tokens are sold\n        return (tokensPerBaseAsset_ * raised_) / LibRaise.PRICE_PRECISION;\n    }\n\n    /// @dev Get amount of unsold tokens.\n    /// @param _raiseId ID of raise\n    /// @return Amount of tokens to reclaim by startup\n    function getUnsold(string memory _raiseId) internal view returns (uint256) {\n        // get all vested tokens\n        uint256 vested_ = LibERC20Asset.getAmount(_raiseId);\n\n        // get sold tokens\n        uint256 sold_ = getSold(_raiseId);\n\n        // return\n        return vested_ - sold_;\n    }\n\n    /// @dev Get amount of unsold tokens.\n    /// @param _raiseId ID of raise\n    /// @param _diff Amount of unsold base asset\n    /// @return Amount of tokens to reclaim by startup\n    function calculateUnsold(string memory _raiseId, uint256 _diff) internal view returns (uint256) {\n        // calculate how much tokens are unsold\n        return (LibRaise.getTokensPerBaseAsset(_raiseId) * _diff) / LibRaise.PRICE_PRECISION;\n    }\n\n    /**************************************\n\n        Getters\n\n     **************************************/\n\n    /// @dev Get amount of raised funds.\n    /// @param _raiseId ID of raise\n    /// @return Amount of collected funds in fundraising\n    function getRaised(string memory _raiseId) internal view returns (uint256) {\n        return LibRaise.getRaised(_raiseId);\n    }\n\n    /// @dev Get softcap limit.\n    /// @param _raiseId ID of raise\n    /// @return Softcap limit\n    function getSoftcap(string memory _raiseId) internal view returns (uint256) {\n        return LibRaise.getSoftcap(_raiseId);\n    }\n\n    /**************************************\n\n        Checks\n\n     **************************************/\n\n    /// @dev Check if raise for given id exists.\n    /// @param _raiseId ID of the raise\n    /// @return True if raise exists\n    function isRaiseExists(string memory _raiseId) internal view returns (bool) {\n        // return\n        return bytes(LibRaise.getId(_raiseId)).length != 0;\n    }\n\n    /// @dev Check if raise is active.\n    /// @param _raiseId ID of raise\n    /// @return True if investment round is ongoing\n    function isRaiseActive(string memory _raiseId) internal view returns (bool) {\n        // tx.members\n        uint256 now_ = block.timestamp;\n\n        // get raise start time\n        uint256 start_ = LibRaise.getStart(_raiseId);\n        // get raise end time\n        uint256 end_ = LibRaise.getEnd(_raiseId);\n\n        // final check\n        return start_ <= now_ && now_ <= end_;\n    }\n\n    /// @dev Validation if raise was completed.\n    /// @param _raiseId ID of raise\n    function validateCompletedRaise(string memory _raiseId) internal view {\n        // verify raise exists\n        if (!isRaiseExists(_raiseId)) {\n            revert RaiseErrors.RaiseDoesNotExists(_raiseId);\n        }\n\n        // check if raise failed already\n        if (LibRaise.getRaiseStatus(_raiseId) != EnumTypes.RaiseStatus.RaiseSucceed) {\n            revert RaiseErrors.RaiseNotSucceed(_raiseId);\n        }\n    }\n\n    /// @dev Check if softcap was achieved.\n    /// @param _raiseId ID of raise\n    /// @return True if softcap was achieved\n    function isSoftcapAchieved(string memory _raiseId) internal view returns (bool) {\n        // return\n        return LibRaise.getSoftcap(_raiseId) <= LibRaise.getRaised(_raiseId);\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/interfaces/milestone/IInvestorClaimMilestoneFacet.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports\nimport { RequestTypes } from \"../../structs/RequestTypes.sol\";\n\n/**************************************\n\n    Investor claim unlocked\n    milestone facet interface\n\n**************************************/\n\n/// @notice Interface for claim unlocked milestone by investor.\ninterface IInvestorClaimMilestoneFacet {\n    // -----------------------------------------------------------------------\n    //                              Claim\n    // -----------------------------------------------------------------------\n\n    /// @dev Claim milestone by investor.\n    /// @dev Validation: Requires raise that is finished and has reached softcap.\n    /// @dev Validation: Can be only called by user that invested in raise.\n    /// @dev Validation: Requires valid cosignature from AngelBlock validator to execute.\n    /// @dev Events: InvestorClaimed(string raiseId, address erc20, address investor, uint256 claimed).\n    /// @param _request InvestorClaimRequest struct\n    /// @param _message EIP712 messages that contains request\n    /// @param _v Part of signature for message\n    /// @param _r Part of signature for message\n    /// @param _s Part of signature for message\n    function claimMilestoneInvestor(\n        RequestTypes.InvestorClaimRequest calldata _request,\n        bytes32 _message,\n        uint8 _v,\n        bytes32 _r,\n        bytes32 _s\n    ) external;\n\n    // -----------------------------------------------------------------------\n    //                              Get available for claim\n    // -----------------------------------------------------------------------\n\n    /// @dev Get available funds to claim upon unlocked milestones by investor.\n    /// @dev Validation: Requires raise that is finished and has reached softcap.\n    /// @param _raiseId ID of raise\n    /// @param _account Address of investor\n    /// @param _investment Investment of user\n    /// @param _proofs Merkle proofs for user and investment\n    /// @return Amount of ERC20 available for claim\n    function getAvailableForInvestor(\n        string memory _raiseId,\n        address _account,\n        uint256 _investment,\n        bytes32[] memory _proofs\n    ) external view returns (uint256);\n}\n"
      },
      "src/fundraising/contracts/fundraising/structs/StorageTypes.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports\nimport { EnumTypes } from \"./EnumTypes.sol\";\n\n/// @notice Library with core storage structs definition.\nlibrary StorageTypes {\n    // -----------------------------------------------------------------------\n    //                              Raise\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct containing main information about the raise.\n    /// @param raiseId UUID of raise\n    /// @param raiseType Type of raise\n    /// @param owner Address of startup\n    struct Raise {\n        string raiseId;\n        EnumTypes.RaiseType raiseType;\n        address owner;\n    }\n\n    /// @dev Struct containing detailed info about raise.\n    /// @param tokensPerBaseAsset Ratio of how much tokens is worth 1 unit of base asset (erc20 * precision / hardcap)\n    /// @param hardcap Max amount of base asset to collect during a raise\n    /// @param softcap Min amount of base asset to collect during a raise\n    /// @param start Start date of raise\n    /// @param end End date of raise\n    struct RaiseDetails {\n        uint256 tokensPerBaseAsset;\n        uint256 hardcap;\n        uint256 softcap;\n        uint256 start;\n        uint256 end;\n    }\n\n    /// @dev Struct containing information about the raise shared across chains.\n    /// @param raised Amount of raised base asset for fundraising\n    /// @param merkleRoot Merkle root compressing all information about investors and their investments\n    struct RaiseDataCC {\n        uint256 raised;\n        bytes32 merkleRoot;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              ERC-20 Asset\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct defining ERC20 offered by startup for investments.\n    /// @param erc20 Address of ERC20 token\n    /// @param chainId ID of network that asset exists\n    /// @param amount Total amount of ERC20 used in vesting\n    struct ERC20Asset {\n        address erc20;\n        uint256 chainId;\n        uint256 amount;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Base Asset\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct defining base asset used for investment on particular chain.\n    /// @param base Address of base asset\n    /// @param chainId ID of network that asset exists\n    struct BaseAsset {\n        address base;\n        uint256 chainId;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Investor Funds Info\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct containing info about state of investor funds.\n    /// @param invested Mapping that stores how much given address invested\n    /// @param investmentRefunded Mapping that tracks if user was refunded\n    struct InvestorFundsInfo {\n        mapping(address => uint256) invested;\n        mapping(address => bool) investmentRefunded;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Startup Funds Info\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct containing info about state of startup funds.\n    /// @param collateralRefunded Boolean describing if startup was refunded\n    /// @param reclaimed Boolean that shows if startup reclaimed unsold tokens\n    struct StartupFundsInfo {\n        bool collateralRefunded;\n        bool reclaimed;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Milestone\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct containing info about milestone and shares it's unlocking.\n    /// @param milestoneId UUID of milestone\n    /// @param milestoneNo Index of milestone (counted from 1)\n    /// @param share % of unlocked tokens (12.5% = 12.5 * 1_000_000)\n    struct Milestone {\n        string milestoneId;\n        uint256 milestoneNo;\n        uint256 share;\n    }\n\n    /// @dev Struct containing milestones and share data.\n    /// @param milestones Ordered list of unlocked milestones containing all their details\n    /// @param unlockedShares Sum of shares from all submitted milestones\n    /// @param rejectedShares Amount of shares reverted back due to failed repair plan\n    /// @param totalShares Sum of all unlocked and rejected shares (should not exceed 100%)\n    struct ShareInfo {\n        Milestone[] milestones;\n        uint256 unlockedShares;\n        uint256 rejectedShares;\n        uint256 totalShares;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Claiming\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct containing frequently used storage for claiming purposes.\n    /// @param investorClaimed Mapping that stores amount claimed of each investor\n    /// @param startupClaimed Amount of claimed assets by startup owner\n    struct ClaimingInfo {\n        mapping(address => uint256) investorClaimed;\n        uint256 startupClaimed;\n    }\n\n    /// @dev Struct containing informations about claiming schedules for investors.\n    /// @param claimingId UUID of claiming\n    /// @param milestoneId UUID of milestone\n    /// @param partialShare Share of milestone tokens which are unlocked in the given claiming\n    /// @param unlockTimestamp Timestamp on which tokens are unlocked\n    struct ClaimingSchedule {\n        string claimingId;\n        string milestoneId;\n        uint256 partialShare;\n        uint256 unlockTimestamp;\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/structs/CrossChainRequestTypes.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports - Structs\nimport { StorageTypes } from \"./StorageTypes.sol\";\nimport { EnumTypes } from \"./EnumTypes.sol\";\n\n/// @notice Library that defines requests sent from frontend to smart contracts.\nlibrary CrossChainRequestTypes {\n    // -----------------------------------------------------------------------\n    //                              Cross chain\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct containing chosen cross-chain provider and encoded data.\n    /// @param provider Cross chain provider\n    /// @param data Data encoding message in format for specific provider\n    struct CrossChainData {\n        EnumTypes.CrossChainProvider provider;\n        bytes data;\n    }\n\n    /// @dev Struct containing base for cross-chain message.\n    /// @param sender Address of sender\n    /// @param nonce Nonce of cross-chain message\n    struct CrossChainBase {\n        address sender;\n        uint256 nonce;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              LayerZero\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct containing cross chain message in LayerZero format\n    /// @param payload Encoded cross-chain call with data\n    /// @param additionalParams Additional parameters for LayerZero\n    /// @param fee Fee covering execution cost\n    struct LayerZeroData {\n        bytes payload;\n        bytes additionalParams;\n        uint256 fee;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              AlephZero\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct containing cross chain message in AlephZero format\n    /// @param nonce Cross chain nonce of tx\n    /// @param fee Unused fee if we would like to publish Bridge\n    /// @param func String name of Substrate function to call\n    /// @param args Byte-encoded cross-chain arguments for function\n    /// @param options Byte-encoded cross chain settings for Bridge tx\n    struct AlephZeroData {\n        uint256 nonce;\n        uint256 fee;\n        bytes4 func;\n        bytes args;\n        bytes options;\n    }\n}\n"
      },
      "src/fundraising/node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/draft-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    function safeTransfer(\n        IERC20 token,\n        address to,\n        uint256 value\n    ) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    function safeTransferFrom(\n        IERC20 token,\n        address from,\n        address to,\n        uint256 value\n    ) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        require(\n            (value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    function safeIncreaseAllowance(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        uint256 newAllowance = token.allowance(address(this), spender) + value;\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n    }\n\n    function safeDecreaseAllowance(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        unchecked {\n            uint256 oldAllowance = token.allowance(address(this), spender);\n            require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n            uint256 newAllowance = oldAllowance - value;\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n        }\n    }\n\n    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        if (returndata.length > 0) {\n            // Return data is optional\n            require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n        }\n    }\n}\n"
      },
      "src/fundraising/node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.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(\n        address from,\n        address to,\n        uint256 amount\n    ) external returns (bool);\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/storage/assets/LibBaseAsset.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports - Structs\nimport { StorageTypes } from \"../../../structs/StorageTypes.sol\";\n\n/// @dev Library containing base asset storage with getters and setters\nlibrary LibBaseAsset {\n    // -----------------------------------------------------------------------\n    //                              Constants\n    // -----------------------------------------------------------------------\n\n    /// @dev Base asset storage pointer.\n    bytes32 internal constant BASE_ASSET_STORAGE_POSITION = keccak256(\"angelblock.fundraising.baseAsset\");\n\n    // -----------------------------------------------------------------------\n    //                              Structs\n    // -----------------------------------------------------------------------\n\n    /// @dev Base asset storage struct.\n    /// @param base Mapping of raise id to base asset struct\n    struct BaseAssetStorage {\n        mapping(string => StorageTypes.BaseAsset) base;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Diamond storage\n    // -----------------------------------------------------------------------\n\n    /// @dev Function returning base asset storage at storage pointer slot.\n    /// @return bas BaseAssetStorage struct instance at storage pointer position\n    function baseAssetStorage() internal pure returns (BaseAssetStorage storage bas) {\n        // declare position\n        bytes32 position = BASE_ASSET_STORAGE_POSITION;\n\n        // set slot to position\n        assembly {\n            bas.slot := position\n        }\n\n        // explicit return\n        return bas;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Getters / setters\n    // -----------------------------------------------------------------------\n\n    /// @dev Diamond storage getter: Base asset address.\n    /// @param _raiseId ID of the raise\n    /// @return Address of the base asset\n    function getAddress(string memory _raiseId) internal view returns (address) {\n        // return\n        return baseAssetStorage().base[_raiseId].base;\n    }\n\n    /// @dev Diamond storage getter: Base asset chain id.\n    /// @param _raiseId ID of the raise\n    /// @return Id of the chain\n    function getChainId(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return baseAssetStorage().base[_raiseId].chainId;\n    }\n\n    /// @dev Diamond storage setter: Base asset\n    /// @param _raiseId ID of the raise\n    /// @param _baseAsset StorageTypes.BaseAsset struct\n    function setBaseAsset(string memory _raiseId, StorageTypes.BaseAsset memory _baseAsset) internal {\n        // set base asset\n        baseAssetStorage().base[_raiseId] = _baseAsset;\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/interfaces/IEscrow.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n/// @notice Interface for escrow contract.\ninterface IEscrow {\n    // -----------------------------------------------------------------------\n    //                              Structs\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct used in 'withdraw' and 'batchWithdraw' function to store receiver data.\n    /// @param receiver Receiver address\n    /// @param amount Amount to send for the given receiver\n    struct ReceiverData {\n        address receiver;\n        uint256 amount;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Events\n    // -----------------------------------------------------------------------\n\n    event Withdraw(address token, address receiver, uint256 amount);\n\n    // -----------------------------------------------------------------------\n    //                              Errors\n    // -----------------------------------------------------------------------\n\n    error InvalidSender(address sender, address expected); // 0xe1130dba\n    error DataMismatch(); // 0x866c41db\n\n    // -----------------------------------------------------------------------\n    //                          External functions\n    // -----------------------------------------------------------------------\n\n    /// @dev Withdrawal of asset from escrow to user.\n    /// @param _token Token to transfer\n    /// @param _receiverData Receiver data (address and amount)\n    function withdraw(address _token, ReceiverData calldata _receiverData) external;\n\n    /// @dev Withdrawal of asset in batch from escrow to users.\n    /// @param _token Token to transfer\n    /// @param _receiverData Array of receivers data (addresses and amounts)\n    function batchWithdraw(address _token, ReceiverData[] calldata _receiverData) external;\n}\n"
      },
      "src/fundraising/contracts/fundraising/errors/RequestErrors.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\nimport { RequestTypes } from \"../structs/RequestTypes.sol\";\n\n/**************************************\n\n    Request errors\n\n**************************************/\n\n/// @dev All errors connected with secure communication.\nlibrary RequestErrors {\n    // -----------------------------------------------------------------------\n    //                              Request\n    // -----------------------------------------------------------------------\n\n    error RequestExpired(address sender, uint256 expiry); // 0x8a288b92\n    error NonceExpired(address sender, uint256 nonce); // 0x2b6069a9\n    error IncorrectSender(address sender); // 0x7da9057e\n    error RaiseCannotBeFinishedYet(string raiseId, uint256 endTimestamp); // 0x7ae96774\n    error BadgeUriEmpty(); // 0xb03cfc55\n    error MerkleRootSet(uint256 raised, uint256 softcap, bytes32 merkleRoot); // 0x77242f66\n    error MerkleRootNotSet(uint256 raised, uint256 softcap, bytes32 merkleRoot); // 0xfe60e7d0\n    error InvalidMerkleProofs(string raiseId, address user, uint256 investment, bytes32[] proofs, bytes32 root, bytes32 leaf); // 0xa112d454\n    error InvalidRaisedAmount(string raiseId, uint256 providedRaised, uint256 correctRaised); // 0x2d6d8be6\n    error RaiseFinishedAlready(string raiseId); // 0xdef0e29b\n}\n"
      },
      "src/fundraising/contracts/fundraising/errors/cross-chain/CrossChainErrors.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\nimport \"../../structs/EnumTypes.sol\";\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\nimport { EnumTypes } from \"../../structs/EnumTypes.sol\";\n\n/**************************************\n\n    Cross-chain errors\n    \n**************************************/\n\n/// @dev All errors used in cross chain communication\nlibrary CrossChainErrors {\n    // -----------------------------------------------------------------------\n    //                              Chain id & Provider\n    // -----------------------------------------------------------------------\n\n    error InvalidChainId(uint256 current, uint256 expected); // 0x9fba672f\n    error UnsupportedChainId(uint256 chainId); // 0xa5dab5fe\n    error ProviderChainIdMismatch(EnumTypes.CrossChainProvider provider, uint256 requestChainId, uint256 blockChainId); // 0x72c80f07\n    error UnsupportedProvider(); // 0x7f4d001d\n    error NotCrossChainRequest(); // 0x5a64c0eb\n\n    // -----------------------------------------------------------------------\n    //                              Payload\n    // -----------------------------------------------------------------------\n\n    error EmptyPayload(); // 0x2e3f1f34\n}\n"
      },
      "src/fundraising/contracts/fundraising/structs/EnumTypes.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n/// @notice Library with core types definition.\nlibrary EnumTypes {\n    // -----------------------------------------------------------------------\n    //                              Raise\n    // -----------------------------------------------------------------------\n\n    /// @dev Definition of supported types of raises.\n    enum RaiseType {\n        Standard,\n        EarlyStage\n    }\n\n    /// @dev Definition of raise statuses.\n    enum RaiseStatus {\n        RaiseCreated,\n        RaiseFailed,\n        RaiseSucceed\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Cross chain\n    // -----------------------------------------------------------------------\n\n    /// @dev Definition of supported cross chain providers.\n    enum CrossChainProvider {\n        None,\n        LayerZero,\n        AlephZero\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/storage/raise/LibRaise.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports - Structs\nimport { StorageTypes } from \"../../../structs/StorageTypes.sol\";\nimport { EnumTypes } from \"../../../structs/EnumTypes.sol\";\n\n/// @notice Library containing raise storage with getters and setters.\nlibrary LibRaise {\n    // -----------------------------------------------------------------------\n    //                              Constants\n    // -----------------------------------------------------------------------\n\n    /// @dev Raise storage pointer.\n    bytes32 internal constant RAISE_STORAGE_POSITION = keccak256(\"angelblock.fundraising.storage.raise\");\n    /// @dev Precision used in price calculation\n    uint256 internal constant PRICE_PRECISION = 10 ** 18;\n\n    // -----------------------------------------------------------------------\n    //                              Structs\n    // -----------------------------------------------------------------------\n\n    /// @dev Raise storage struct.\n    /// @param raises Mapping of raise id to particular raise struct\n    /// @param raiseDetails Mapping of raise id to vested token information\n    /// @param raiseDataCrosschains Mapping of raise id to raise state information\n    /// @param raiseStatus Status of raise\n    struct RaiseStorage {\n        mapping(string => StorageTypes.Raise) raises;\n        mapping(string => StorageTypes.RaiseDetails) raiseDetails;\n        mapping(string => StorageTypes.RaiseDataCC) raiseDataCrosschains;\n        mapping(string => EnumTypes.RaiseStatus) raiseStatus;\n    }\n\n    // diamond storage getter\n    function raiseStorage() internal pure returns (RaiseStorage storage rs) {\n        // declare position\n        bytes32 position = RAISE_STORAGE_POSITION;\n\n        // set slot to position\n        assembly {\n            rs.slot := position\n        }\n\n        // explicit return\n        return rs;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Getters / setters\n    // -----------------------------------------------------------------------\n\n    /// @dev Diamond storage getter: raise id.\n    /// @param _raiseId Requested raise id\n    /// @return Existing raise id\n    function getId(string memory _raiseId) internal view returns (string memory) {\n        // return\n        return raiseStorage().raises[_raiseId].raiseId;\n    }\n\n    /// @dev Diamond storage getter: raise type.\n    /// @param _raiseId Raise id\n    /// @return Raise type\n    function getType(string memory _raiseId) internal view returns (EnumTypes.RaiseType) {\n        // return\n        return raiseStorage().raises[_raiseId].raiseType;\n    }\n\n    /// @dev Diamond storage getter: raise owner.\n    /// @param _raiseId Raise id\n    /// @return Raise owner\n    function getOwner(string memory _raiseId) internal view returns (address) {\n        // return\n        return raiseStorage().raises[_raiseId].owner;\n    }\n\n    /// @dev Diamond storage getter: tokens per base asset.\n    /// @param _raiseId Raise id\n    /// @return Tokens per base asset\n    function getTokensPerBaseAsset(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return raiseStorage().raiseDetails[_raiseId].tokensPerBaseAsset;\n    }\n\n    /// @dev Diamond storage getter: hardcap.\n    /// @param _raiseId Raise id\n    /// @return Hardcap\n    function getHardcap(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return raiseStorage().raiseDetails[_raiseId].hardcap;\n    }\n\n    /// @dev Diamond storage getter: softcap.\n    /// @param _raiseId Raise id\n    /// @return Softcap\n    function getSoftcap(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return raiseStorage().raiseDetails[_raiseId].softcap;\n    }\n\n    /// @dev Diamond storage getter: raise start.\n    /// @param _raiseId Raise id\n    /// @return Start date of raise\n    function getStart(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return raiseStorage().raiseDetails[_raiseId].start;\n    }\n\n    /// @dev Diamond storage getter: raise end.\n    /// @param _raiseId Raise id\n    /// @return End date of raise\n    function getEnd(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return raiseStorage().raiseDetails[_raiseId].end;\n    }\n\n    /// @dev Diamond storage getter: raised.\n    /// @param _raiseId Raise id\n    /// @return Raised amount\n    function getRaised(string memory _raiseId) internal view returns (uint256) {\n        // return\n        return raiseStorage().raiseDataCrosschains[_raiseId].raised;\n    }\n\n    /// @dev Diamond storage getter: raise status.\n    /// @param _raiseId Raise id\n    /// @return Status of raise with provided id\n    function getRaiseStatus(string memory _raiseId) internal view returns (EnumTypes.RaiseStatus) {\n        return raiseStorage().raiseStatus[_raiseId];\n    }\n\n    /// @dev Diamond storage getter: merkle root.\n    /// @param _raiseId Raise id\n    /// @return Merkle root\n    function getMerkleRoot(string memory _raiseId) internal view returns (bytes32) {\n        return raiseStorage().raiseDataCrosschains[_raiseId].merkleRoot;\n    }\n\n    /// @dev Diamond storage setter: set raise.\n    /// @param _raiseId Raise id\n    /// @param _raise Raise struct\n    function setRaise(string memory _raiseId, StorageTypes.Raise memory _raise) internal {\n        // set raise\n        raiseStorage().raises[_raiseId] = _raise;\n    }\n\n    /// @dev Diamond storage setter: set raise details.\n    /// @param _raiseId Raise id\n    /// @param _raiseDetails Raise details struct\n    function setRaiseDetails(string memory _raiseId, StorageTypes.RaiseDetails memory _raiseDetails) internal {\n        // set raise details\n        raiseStorage().raiseDetails[_raiseId] = _raiseDetails;\n    }\n\n    /// @dev Diamond storage setter: set raise cross-chain data.\n    /// @param _raiseId Raise id\n    /// @param _raiseDataCC Raise cross-chain data struct\n    function setRaiseDataCrosschain(string memory _raiseId, StorageTypes.RaiseDataCC memory _raiseDataCC) internal {\n        // set cross-chain raise data\n        raiseStorage().raiseDataCrosschains[_raiseId] = _raiseDataCC;\n    }\n\n    /// @dev Diamond storage setter: raise status.\n    /// @param _raiseId Raise id\n    /// @param _status Raise enum status\n    function setRaiseStatus(string memory _raiseId, EnumTypes.RaiseStatus _status) internal {\n        raiseStorage().raiseStatus[_raiseId] = _status;\n    }\n\n    /// @dev Diamond storage setter: set end.\n    /// @param _raiseId Raise id\n    /// @param _end End date of fundraising\n    function setEnd(string memory _raiseId, uint256 _end) internal {\n        // set raise end date\n        raiseStorage().raiseDetails[_raiseId].end = _end;\n    }\n\n    /// @dev Diamond storage setter: increase raised amount.\n    /// @param _raiseId Raise id\n    /// @param _amount Raised increment of amount\n    function increaseRaised(string memory _raiseId, uint256 _amount) internal {\n        raiseStorage().raiseDataCrosschains[_raiseId].raised += _amount;\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/storage/milestone/LibClaimingSchedule.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// Local imports\nimport { StorageTypes } from \"../../../structs/StorageTypes.sol\";\n\n/**************************************\n\n    Claiming schedule library\n\n    ------------------------------\n\n    Diamond storage containing claiming schedule data\n\n **************************************/\n\n/// @notice Library containing ClaimingScheduleStorage and low level functions.\nlibrary LibClaimingSchedule {\n    // -----------------------------------------------------------------------\n    //                              Constants\n    // -----------------------------------------------------------------------\n\n    /// @dev Claiming schedule storage pointer.\n    bytes32 private constant CLAIMING_SCHEDULES_STORAGE_POSITION = keccak256(\"angelblock.fundraising.claiming.schedule\");\n\n    // -----------------------------------------------------------------------\n    //                              Structs\n    // -----------------------------------------------------------------------\n\n    /// @dev Claiming schedule storage struct.\n    /// @param claimingScheduleIds Ids of claiming schedules for given milestone id\n    /// @param claimingSchedules Mapping of claiming schedules\n    struct ClaimingScheduleStorage {\n        mapping(string => string[]) claimingScheduleIds;\n        mapping(string => mapping(string => StorageTypes.ClaimingSchedule)) claimingSchedules;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Diamond storage\n    // -----------------------------------------------------------------------\n\n    /// @dev Function returning claiming schedule storage at storage pointer slot.\n    /// @return css ClaimingScheduleStorage struct instance at storage pointer position\n    function claimingScheduleStorage() private pure returns (ClaimingScheduleStorage storage css) {\n        // declare position\n        bytes32 position = CLAIMING_SCHEDULES_STORAGE_POSITION;\n\n        // set slot to position\n        assembly {\n            css.slot := position\n        }\n\n        // explicit return\n        return css;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Getters / Setters\n    // -----------------------------------------------------------------------\n\n    /// @dev Diamond storage getter: claiming schedules -> length.\n    /// @param _milestoneId ID of milestone\n    /// @return Length of claiming schedules\n    function claimingScheduleCount(string memory _milestoneId) internal view returns (uint256) {\n        return claimingScheduleStorage().claimingScheduleIds[_milestoneId].length;\n    }\n\n    /// @dev Diamond storage getter: claiming schedule ids.\n    /// @param _milestoneId ID of milestone\n    /// @return Array of claiming schedule ids\n    function getClaimingScheduleIds(string memory _milestoneId) internal view returns (string[] memory) {\n        return claimingScheduleStorage().claimingScheduleIds[_milestoneId];\n    }\n\n    /// @dev Diamond storage getter: claiming schedule.\n    /// @param _milestoneId ID of milestone\n    /// @param _claimingScheduleId ID of claiming schedule\n    /// @return Claiming schedule struct\n    function getClaimingSchedule(\n        string memory _milestoneId,\n        string memory _claimingScheduleId\n    ) internal view returns (StorageTypes.ClaimingSchedule memory) {\n        return claimingScheduleStorage().claimingSchedules[_milestoneId][_claimingScheduleId];\n    }\n\n    /// @dev Diamond storage getter: claiming schedule -> partial share\n    /// @param _milestoneId ID of milestone\n    /// @param _claimingScheduleId ID of claiming schedule\n    /// @return Claiming schedule partial share\n    function getPartialShare(string memory _milestoneId, string memory _claimingScheduleId) internal view returns (uint256) {\n        return claimingScheduleStorage().claimingSchedules[_milestoneId][_claimingScheduleId].partialShare;\n    }\n\n    /// @dev Diamond storage getter: claiming schedule -> unlock timestamp\n    /// @param _milestoneId ID of milestone\n    /// @param _claimingScheduleId ID of claiming schedule\n    /// @return Claiming schedule unlock timestamp\n    function getUnlockTimestamp(string memory _milestoneId, string memory _claimingScheduleId) internal view returns (uint256) {\n        return claimingScheduleStorage().claimingSchedules[_milestoneId][_claimingScheduleId].unlockTimestamp;\n    }\n\n    /// @dev Diamond storage setter: add claiming schedule.\n    /// @param _claimingSchedule Claiming schedule to add\n    function setClaimingSchedule(StorageTypes.ClaimingSchedule memory _claimingSchedule) internal {\n        // add claiming schedule id to ids in storage\n        claimingScheduleStorage().claimingScheduleIds[_claimingSchedule.milestoneId].push(_claimingSchedule.claimingId);\n\n        // set claiming schedule\n        claimingScheduleStorage().claimingSchedules[_claimingSchedule.milestoneId][_claimingSchedule.claimingId] = _claimingSchedule;\n    }\n\n    /// @dev Diamond storage setter: set claiming schedule unlock timestamp.\n    /// @param _milestoneId ID of milestone\n    /// @param _claimingScheduleId ID of claiming schedule\n    /// @param _newUnlockTimestamp New unlock timestamp\n    function setUnlockTimestamp(string memory _milestoneId, string memory _claimingScheduleId, uint256 _newUnlockTimestamp) internal {\n        // set claiming schedule unlock timestamp\n        claimingScheduleStorage().claimingSchedules[_milestoneId][_claimingScheduleId].unlockTimestamp = _newUnlockTimestamp;\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/services/assets/internal/ERC20AssetService.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// OpenZeppelin imports\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n// Local imports - constants, encoders, events, errors, structs\nimport { RaiseErrors } from \"../../../../errors/RaiseErrors.sol\";\nimport { MilestoneErrors } from \"../../../../errors/MilestoneErrors.sol\";\n\n// Local imports - storages\nimport { LibERC20Asset } from \"../../../storage/assets/LibERC20Asset.sol\";\nimport { LibEscrow } from \"../../../storage/assets/LibEscrow.sol\";\n\nlibrary ERC20AssetService {\n    using SafeERC20 for IERC20;\n\n    /// @dev Collect vested ERC20 to start a raise.\n    /// @dev Validation: Requires startup to have enough ERC20 and provide allowance.\n    /// @dev Events: Transfer(address from, address to, uint256 value).\n    /// @param _token Address of ERC20\n    /// @param _sender Address of startup to withdraw ERC20 from\n    /// @param _escrow Address of cloned Escrow instance for raise\n    /// @param _amount Amount of ERC20 to collect\n    function collectVestedToken(address _token, address _sender, address _escrow, uint256 _amount) internal {\n        // tx.members\n        address self_ = address(this);\n\n        // erc20\n        IERC20 erc20_ = IERC20(_token);\n\n        // allowance check\n        uint256 allowance_ = erc20_.allowance(_sender, self_);\n\n        // validate if allowance greater or equal amount\n        if (allowance_ < _amount) {\n            revert RaiseErrors.NotEnoughAllowance(_sender, self_, allowance_);\n        }\n\n        // vest erc20\n        erc20_.safeTransferFrom(_sender, _escrow, _amount);\n    }\n\n    /// @dev Get ERC20 asset chain id.\n    /// @param _raiseId Raise id\n    /// @return ERC20Asset chain id\n    function getERC20AssetChainId(string memory _raiseId) internal view returns (uint256) {\n        return LibERC20Asset.getChainId(_raiseId);\n    }\n\n    /// @dev Validate an early stage raise.\n    /// @param _raiseId Raise id\n    function validateEarlyStageERC20(string memory _raiseId) internal view {\n        // get erc20\n        address erc20_ = LibERC20Asset.getAddress(_raiseId);\n\n        // check if erc20 address is set\n        if (erc20_ == address(0)) revert RaiseErrors.TokenNotSet(_raiseId);\n\n        // get escrow\n        address escrow_ = LibEscrow.getEscrow(_raiseId);\n\n        // check if erc20 is present on escrow for claiming\n        if (IERC20(erc20_).balanceOf(escrow_) == 0) {\n            revert MilestoneErrors.TokenNotOnEscrow(_raiseId);\n        }\n    }\n}\n"
      },
      "src/fundraising/node_modules/@openzeppelin/contracts/utils/cryptography/MerkleProof.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle Tree proofs.\n *\n * The tree and the proofs can be generated using our\n * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].\n * You will find a quickstart guide in the readme.\n *\n * WARNING: You should avoid using leaf values that are 64 bytes long prior to\n * hashing, or use a hash function other than keccak256 for hashing leaves.\n * This is because the concatenation of a sorted pair of internal nodes in\n * the merkle tree could be reinterpreted as a leaf value.\n * OpenZeppelin's JavaScript library generates merkle trees that are safe\n * against this attack out of the box.\n */\nlibrary MerkleProof {\n    /**\n     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree\n     * defined by `root`. For this, a `proof` must be provided, containing\n     * sibling hashes on the branch from the leaf to the root of the tree. Each\n     * pair of leaves and each pair of pre-images are assumed to be sorted.\n     */\n    function verify(\n        bytes32[] memory proof,\n        bytes32 root,\n        bytes32 leaf\n    ) internal pure returns (bool) {\n        return processProof(proof, leaf) == root;\n    }\n\n    /**\n     * @dev Calldata version of {verify}\n     *\n     * _Available since v4.7._\n     */\n    function verifyCalldata(\n        bytes32[] calldata proof,\n        bytes32 root,\n        bytes32 leaf\n    ) internal pure returns (bool) {\n        return processProofCalldata(proof, leaf) == root;\n    }\n\n    /**\n     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n     * hash matches the root of the tree. When processing the proof, the pairs\n     * of leafs & pre-images are assumed to be sorted.\n     *\n     * _Available since v4.4._\n     */\n    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {\n        bytes32 computedHash = leaf;\n        for (uint256 i = 0; i < proof.length; i++) {\n            computedHash = _hashPair(computedHash, proof[i]);\n        }\n        return computedHash;\n    }\n\n    /**\n     * @dev Calldata version of {processProof}\n     *\n     * _Available since v4.7._\n     */\n    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {\n        bytes32 computedHash = leaf;\n        for (uint256 i = 0; i < proof.length; i++) {\n            computedHash = _hashPair(computedHash, proof[i]);\n        }\n        return computedHash;\n    }\n\n    /**\n     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by\n     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.\n     *\n     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n     *\n     * _Available since v4.7._\n     */\n    function multiProofVerify(\n        bytes32[] memory proof,\n        bool[] memory proofFlags,\n        bytes32 root,\n        bytes32[] memory leaves\n    ) internal pure returns (bool) {\n        return processMultiProof(proof, proofFlags, leaves) == root;\n    }\n\n    /**\n     * @dev Calldata version of {multiProofVerify}\n     *\n     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n     *\n     * _Available since v4.7._\n     */\n    function multiProofVerifyCalldata(\n        bytes32[] calldata proof,\n        bool[] calldata proofFlags,\n        bytes32 root,\n        bytes32[] memory leaves\n    ) internal pure returns (bool) {\n        return processMultiProofCalldata(proof, proofFlags, leaves) == root;\n    }\n\n    /**\n     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction\n     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another\n     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false\n     * respectively.\n     *\n     * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree\n     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the\n     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).\n     *\n     * _Available since v4.7._\n     */\n    function processMultiProof(\n        bytes32[] memory proof,\n        bool[] memory proofFlags,\n        bytes32[] memory leaves\n    ) internal pure returns (bytes32 merkleRoot) {\n        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by\n        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n        // the merkle tree.\n        uint256 leavesLen = leaves.length;\n        uint256 totalHashes = proofFlags.length;\n\n        // Check proof validity.\n        require(leavesLen + proof.length - 1 == totalHashes, \"MerkleProof: invalid multiproof\");\n\n        // The xxxPos values are \"pointers\" to the next value to consume in each array. All accesses are done using\n        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's \"pop\".\n        bytes32[] memory hashes = new bytes32[](totalHashes);\n        uint256 leafPos = 0;\n        uint256 hashPos = 0;\n        uint256 proofPos = 0;\n        // At each step, we compute the next hash using two values:\n        // - a value from the \"main queue\". If not all leaves have been consumed, we get the next leaf, otherwise we\n        //   get the next hash.\n        // - depending on the flag, either another value for the \"main queue\" (merging branches) or an element from the\n        //   `proof` array.\n        for (uint256 i = 0; i < totalHashes; i++) {\n            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];\n            hashes[i] = _hashPair(a, b);\n        }\n\n        if (totalHashes > 0) {\n            return hashes[totalHashes - 1];\n        } else if (leavesLen > 0) {\n            return leaves[0];\n        } else {\n            return proof[0];\n        }\n    }\n\n    /**\n     * @dev Calldata version of {processMultiProof}.\n     *\n     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n     *\n     * _Available since v4.7._\n     */\n    function processMultiProofCalldata(\n        bytes32[] calldata proof,\n        bool[] calldata proofFlags,\n        bytes32[] memory leaves\n    ) internal pure returns (bytes32 merkleRoot) {\n        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by\n        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n        // the merkle tree.\n        uint256 leavesLen = leaves.length;\n        uint256 totalHashes = proofFlags.length;\n\n        // Check proof validity.\n        require(leavesLen + proof.length - 1 == totalHashes, \"MerkleProof: invalid multiproof\");\n\n        // The xxxPos values are \"pointers\" to the next value to consume in each array. All accesses are done using\n        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's \"pop\".\n        bytes32[] memory hashes = new bytes32[](totalHashes);\n        uint256 leafPos = 0;\n        uint256 hashPos = 0;\n        uint256 proofPos = 0;\n        // At each step, we compute the next hash using two values:\n        // - a value from the \"main queue\". If not all leaves have been consumed, we get the next leaf, otherwise we\n        //   get the next hash.\n        // - depending on the flag, either another value for the \"main queue\" (merging branches) or an element from the\n        //   `proof` array.\n        for (uint256 i = 0; i < totalHashes; i++) {\n            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];\n            hashes[i] = _hashPair(a, b);\n        }\n\n        if (totalHashes > 0) {\n            return hashes[totalHashes - 1];\n        } else if (leavesLen > 0) {\n            return leaves[0];\n        } else {\n            return proof[0];\n        }\n    }\n\n    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {\n        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);\n    }\n\n    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x00, a)\n            mstore(0x20, b)\n            value := keccak256(0x00, 0x40)\n        }\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/storage/utils/LibNonce.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n/**************************************\n\n    Nonce library\n\n    ------------------------------\n\n    Diamond storage containing nonces\n\n **************************************/\n\n/// @notice Library implementing NonceStorage and functions.\nlibrary LibNonce {\n    // -----------------------------------------------------------------------\n    //                              Storage pointer\n    // -----------------------------------------------------------------------\n\n    /// @dev Storage pointer.\n    bytes32 internal constant NONCE_STORAGE_POSITION = keccak256(\"angelblock.fundraising.nonce\");\n\n    // -----------------------------------------------------------------------\n    //                              Structs\n    // -----------------------------------------------------------------------\n\n    /// @dev Nonce diamond storage.\n    /// @param nonces Mapping of address to nonce information.\n    struct NonceStorage {\n        mapping(address => uint256) nonces;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Diamond storage\n    // -----------------------------------------------------------------------\n\n    /// @dev Function returning nonce storage at storage pointer slot.\n    /// @return ns NonceStorage struct instance at storage pointer position\n    function nonceStorage() internal pure returns (NonceStorage storage ns) {\n        // declare position\n        bytes32 position = NONCE_STORAGE_POSITION;\n\n        // set slot to position\n        assembly {\n            ns.slot := position\n        }\n\n        // explicit return\n        return ns;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Getters / setters\n    // -----------------------------------------------------------------------\n\n    /// @dev Diamond storage getter: nonce per account.\n    /// @param _account Address for which nonce should be checked\n    /// @return Current nonce of account\n    function getLastNonce(address _account) internal view returns (uint256) {\n        // return\n        return nonceStorage().nonces[_account];\n    }\n\n    /// @dev Diamond storage setter: nonce per account.\n    /// @param _account Address for which nonce should be set\n    /// @param _nonce New value for nonce\n    function setNonce(address _account, uint256 _nonce) internal {\n        // get storage\n        NonceStorage storage ns = nonceStorage();\n\n        // set nonce\n        ns.nonces[_account] = _nonce;\n    }\n}\n"
      },
      "src/fundraising/node_modules/@openzeppelin/contracts/utils/cryptography/ECDSA.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Strings.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n    enum RecoverError {\n        NoError,\n        InvalidSignature,\n        InvalidSignatureLength,\n        InvalidSignatureS,\n        InvalidSignatureV // Deprecated in v4.8\n    }\n\n    function _throwError(RecoverError error) private pure {\n        if (error == RecoverError.NoError) {\n            return; // no error: do nothing\n        } else if (error == RecoverError.InvalidSignature) {\n            revert(\"ECDSA: invalid signature\");\n        } else if (error == RecoverError.InvalidSignatureLength) {\n            revert(\"ECDSA: invalid signature length\");\n        } else if (error == RecoverError.InvalidSignatureS) {\n            revert(\"ECDSA: invalid signature 's' value\");\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature` or error string. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {toEthSignedMessageHash} on it.\n     *\n     * Documentation for signature generation:\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n     *\n     * _Available since v4.3._\n     */\n    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            /// @solidity memory-safe-assembly\n            assembly {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            return tryRecover(hash, v, r, s);\n        } else {\n            return (address(0), RecoverError.InvalidSignatureLength);\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature`. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {toEthSignedMessageHash} on it.\n     */\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n        (address recovered, RecoverError error) = tryRecover(hash, signature);\n        _throwError(error);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n     *\n     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n     *\n     * _Available since v4.3._\n     */\n    function tryRecover(\n        bytes32 hash,\n        bytes32 r,\n        bytes32 vs\n    ) internal pure returns (address, RecoverError) {\n        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n        uint8 v = uint8((uint256(vs) >> 255) + 27);\n        return tryRecover(hash, v, r, s);\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n     *\n     * _Available since v4.2._\n     */\n    function recover(\n        bytes32 hash,\n        bytes32 r,\n        bytes32 vs\n    ) internal pure returns (address) {\n        (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n        _throwError(error);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     *\n     * _Available since v4.3._\n     */\n    function tryRecover(\n        bytes32 hash,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal pure returns (address, RecoverError) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n            return (address(0), RecoverError.InvalidSignatureS);\n        }\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(hash, v, r, s);\n        if (signer == address(0)) {\n            return (address(0), RecoverError.InvalidSignature);\n        }\n\n        return (signer, RecoverError.NoError);\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function recover(\n        bytes32 hash,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal pure returns (address) {\n        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n        _throwError(error);\n        return recovered;\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n     * produces hash corresponding to the one signed with the\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n     * JSON-RPC method as part of EIP-191.\n     *\n     * See {recover}.\n     */\n    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n        // 32 is the length in bytes of hash,\n        // enforced by the type signature above\n        return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Message, created from `s`. This\n     * produces hash corresponding to the one signed with the\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n     * JSON-RPC method as part of EIP-191.\n     *\n     * See {recover}.\n     */\n    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", Strings.toString(s.length), s));\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Typed Data, created from a\n     * `domainSeparator` and a `structHash`. This produces hash corresponding\n     * to the one signed with the\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n     * JSON-RPC method as part of EIP-712.\n     *\n     * See {recover}.\n     */\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/constants/SignatureConstants.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n/// @notice Constants used in signature verification.\nlibrary SignatureConstants {\n    // -----------------------------------------------------------------------\n    //                              Constants\n    // -----------------------------------------------------------------------\n\n    /// @dev EIP-712 typehash\n    bytes32 internal constant EIP712_DOMAIN_TYPEHASH =\n        keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n}\n"
      },
      "src/fundraising/contracts/fundraising/errors/SignatureErrors.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n/**************************************\n\n    Signature errors\n    \n**************************************/\n\n/// @dev All errors used in the signature verification\nlibrary SignatureErrors {\n    error IncorrectSigner(address signer); // 0x33ffff9b\n    error InvalidMessage(bytes32 verify, bytes32 message); // 0xeeba4d9c\n}\n"
      },
      "src/fundraising/contracts/fundraising/structs/AccessTypes.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n/// @notice Library containing role definition for access management.\nlibrary AccessTypes {\n    // -----------------------------------------------------------------------\n    //                              Constants\n    // -----------------------------------------------------------------------\n\n    /// @dev AngelBlock validator role\n    bytes32 internal constant SIGNER_ROLE = keccak256(\"IS SIGNER\");\n    /// @dev LayerZero receiver's admin role\n    bytes32 internal constant LZ_RECEIVER_ADMIN_ROLE = keccak256(\"LZ RECEIVER ADMIN\");\n}\n"
      },
      "src/fundraising/contracts/fundraising/libraries/storage/utils/LibAccessControl.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n// OpenZeppelin imports\nimport { Strings } from \"@openzeppelin/contracts/utils/Strings.sol\";\nimport { IAccessControl } from \"@openzeppelin/contracts/access/IAccessControl.sol\";\n\n/**************************************\n\n    AccessControl library\n\n    ------------------------------\n\n    Diamond storage containing access control data\n\n **************************************/\n\n/// @notice Fork of OpenZeppelin's AccessControl that fits as diamond proxy library.\nlibrary LibAccessControl {\n    // -----------------------------------------------------------------------\n    //                              Storage pointer\n    // -----------------------------------------------------------------------\n\n    /// @dev Access control storage pointer.\n    bytes32 internal constant ACCESS_CONTROL_STORAGE_POSITION = keccak256(\"angelblock.access.control\");\n\n    // -----------------------------------------------------------------------\n    //                              Constants\n    // -----------------------------------------------------------------------\n\n    /// @dev Default admin role\n    bytes32 internal constant ADMIN_ROLE = 0x00;\n\n    // -----------------------------------------------------------------------\n    //                                  Structs\n    // -----------------------------------------------------------------------\n\n    /// @dev Struct containing role settings.\n    /// @param members Mapping of addresses, that returns True if user is a member\n    /// @param adminRole Byte-encoded string of admin role for given role\n    struct RoleData {\n        mapping(address => bool) members;\n        bytes32 adminRole;\n    }\n\n    /// @dev Access control storage struct.\n    /// @param roles Mapping of byte-encoded strings of roles to RoleData struct\n    /// @param initialized Used to allow and keep track of admin to be created once\n    struct AccessControlStorage {\n        mapping(bytes32 => RoleData) roles;\n        bool initialized;\n    }\n\n    // -----------------------------------------------------------------------\n    //                                  Events\n    // -----------------------------------------------------------------------\n\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    // -----------------------------------------------------------------------\n    //                                  Errors\n    // -----------------------------------------------------------------------\n\n    error CannotSetAdminForAdmin(); // 0x625dd4af\n    error CanOnlyRenounceSelf(); // 0x4b47a2fd\n\n    // -----------------------------------------------------------------------\n    //                                  Modifiers\n    // -----------------------------------------------------------------------\n\n    /// @dev Modifier that checks if caller has given role.\n    /// @dev Validation: Expect caller to be a member of role.\n    /// @param _role Expected role for sender to be a member of\n    modifier onlyRole(bytes32 _role) {\n        // check role\n        if (!hasRole(_role, msg.sender)) {\n            revert(\n                string(\n                    abi.encodePacked(\n                        \"AccessControl: account \",\n                        Strings.toHexString(msg.sender),\n                        \" is missing role \",\n                        Strings.toHexString(uint256(_role), 32)\n                    )\n                )\n            );\n        }\n        _;\n    }\n\n    // -----------------------------------------------------------------------\n    //                                  Diamond storage\n    // -----------------------------------------------------------------------\n\n    /// @dev Function returning access control storage at storage pointer slot.\n    /// @return acs AccessControlStorage struct instance at storage pointer position\n    function accessStorage() internal pure returns (AccessControlStorage storage acs) {\n        // declare position\n        bytes32 position = ACCESS_CONTROL_STORAGE_POSITION;\n\n        // set slot to position\n        assembly {\n            acs.slot := position\n        }\n\n        // explicit return\n        return acs;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Getters / setters\n    // -----------------------------------------------------------------------\n\n    /// @dev Diamond storage getter: roles->hasRole(account).\n    /// @param _role Byte-encoded role\n    /// @param _account Address to check role\n    /// @return True if account is member of given role\n    function hasRole(bytes32 _role, address _account) internal view returns (bool) {\n        // return\n        return accessStorage().roles[_role].members[_account];\n    }\n\n    /// @dev Diamond storage setter: roles->setAdmin(account).\n    /// @param _account Address to become an admin\n    function createAdmin(address _account) internal {\n        // set role\n        accessStorage().roles[ADMIN_ROLE].members[_account] = true;\n    }\n\n    /// @dev Diamond storage getter: roles->getAdminRole(role).\n    /// @param _role Byte-encoded role\n    /// @return Admin role for given role\n    function getRoleAdmin(bytes32 _role) internal view returns (bytes32) {\n        // return\n        return accessStorage().roles[_role].adminRole;\n    }\n\n    /// @dev Diamond storage setter: roles->setAdminRole(role).\n    /// @dev Validation: Only main admin role can change admin role for given role.\n    /// @dev Validation: Admin role for default admin role cannot be changed.\n    /// @param _role Byte-encoded role to set admin role\n    /// @param _adminRole Byte-encoded admin role for given role\n    function setRoleAdmin(bytes32 _role, bytes32 _adminRole) internal onlyRole(ADMIN_ROLE) {\n        // accept each role except admin\n        if (_role != ADMIN_ROLE) accessStorage().roles[_role].adminRole = _adminRole;\n        else revert CannotSetAdminForAdmin();\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Functions\n    // -----------------------------------------------------------------------\n\n    /**************************************\n\n        Grant role\n\n     **************************************/\n\n    /// @dev Grant role to an account.\n    /// @dev Validation: Can only be called by the admin of the role.\n    /// @dev Validation: Will not grant role if account already has a desired role.\n    /// @dev Events: RoleGranted(bytes32 role, address account, address sender).\n    /// @param _role Byte-encoded role\n    /// @param _account Address to receive a role\n    function grantRole(bytes32 _role, address _account) internal onlyRole(getRoleAdmin(_role)) {\n        // grant\n        _grantRole(_role, _account);\n    }\n\n    /**************************************\n\n        Revoke role\n\n     **************************************/\n\n    /// @dev Revoke role of account. Will not revoke role if account doesn't have it.\n    /// @dev Validation: Can only be called by the admin of the role.\n    /// @dev Events: RoleRevoked(bytes32 role, address account, address sender).\n    /// @param _role Byte-encoded role\n    /// @param _account Address of account that has role\n    function revokeRole(bytes32 _role, address _account) internal onlyRole(getRoleAdmin(_role)) {\n        // revoke\n        _revokeRole(_role, _account);\n    }\n\n    /**************************************\n\n        Renounce role\n\n     **************************************/\n\n    /// @dev Renounce role of account. Will not renounce role if account doesn't have it.\n    /// @dev Validation: Can only be called by the user that has role.\n    /// @dev Events: RoleRevoked(bytes32 role, address account, address sender).\n    /// @param _role Byte-encoded role\n    /// @param _account Address of account that has role\n    function renounceRole(bytes32 _role, address _account) internal {\n        // check sender\n        if (_account != msg.sender) {\n            revert CanOnlyRenounceSelf();\n        }\n\n        // revoke\n        _revokeRole(_role, _account);\n    }\n\n    /**************************************\n\n        Low level: grant\n\n     **************************************/\n\n    /// @dev Grant role to an account.\n    /// @dev Validation: Will not grant role if account already has a desired role.\n    /// @dev Events: RoleGranted(bytes32 role, address account, address sender).\n    /// @param _role Byte-encoded role\n    /// @param _account Address to receive a role\n    function _grantRole(bytes32 _role, address _account) private {\n        // check if not have role already\n        if (!hasRole(_role, _account)) {\n            // grant role\n            accessStorage().roles[_role].members[_account] = true;\n\n            // event\n            emit RoleGranted(_role, _account, msg.sender);\n        }\n    }\n\n    /**************************************\n\n        Low level: revoke\n\n     **************************************/\n\n    /// @dev Revoke role of an account. Will not revoke role if account doesn't have it.\n    /// @dev Events: RoleRevoked(bytes32 role, address account, address sender).\n    /// @param _role Byte-encoded role\n    /// @param _account Address of account that has role\n    function _revokeRole(bytes32 _role, address _account) private {\n        // check if have role\n        if (hasRole(_role, _account)) {\n            // revoke role\n            accessStorage().roles[_role].members[_account] = false;\n\n            // event\n            emit RoleRevoked(_role, _account, msg.sender);\n        }\n    }\n}\n"
      },
      "src/fundraising/contracts/fundraising/errors/RaiseErrors.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    security-contact:\n    - security@angelblock.io\n\n    maintainers:\n    - marcin@angelblock.io\n    - piotr@angelblock.io\n    - mikolaj@angelblock.io\n    - sebastian@angelblock.io\n\n    contributors:\n    - domenico@angelblock.io\n\n**************************************/\n\n/**************************************\n\n    Raise errors\n\n**************************************/\n\n/// @dev All errors connected with raises.\nlibrary RaiseErrors {\n    // -----------------------------------------------------------------------\n    //                              Raise Creation\n    // -----------------------------------------------------------------------\n\n    error InvalidRaiseId(string raiseId); // 0xc2f9a803\n    error InvalidRaiseStartEnd(uint256 start, uint256 end); // 0xb2fb4a1d\n    error InvalidVestedAmount(); // 0x17329d67\n    error PriceNotMatchConfiguration(uint256 price, uint256 hardcap, uint256 vested); // 0x643c0fc5\n    error InvalidTokenAddress(address token); // 0x73306803\n\n    // -----------------------------------------------------------------------\n    //                              Early Stage\n    // -----------------------------------------------------------------------\n\n    error OnlyForEarlyStage(string raiseId); // 0x2e14bd97\n    error CannotForEarlyStage(string raiseId); // 0x28471ed7\n    error TokenAlreadySet(string raiseId); // 0x11f125e1\n    error TokenNotSet(string raiseId); // 0x64d2ac41\n\n    // -----------------------------------------------------------------------\n    //                              Investing\n    // -----------------------------------------------------------------------\n\n    error IncorrectAmount(uint256 amount); // 0x88967d2f\n    error OwnerCannotInvest(address sender, string raiseId); // 0x44b4eea9\n    error InvestmentOverLimit(uint256 existingInvestment, uint256 newInvestment, uint256 maxTicketSize); // 0x3ebbf796\n    error InvestmentOverHardcap(uint256 existingInvestment, uint256 newInvestment, uint256 hardcap); // 0xf0152bdf\n    error NotEnoughBalanceForInvestment(address sender, uint256 investment); // 0xaff6db15\n    error NotEnoughAllowance(address sender, address spender, uint256 amount); // 0x892e7739\n\n    // -----------------------------------------------------------------------\n    //                              Raise State\n    // -----------------------------------------------------------------------\n\n    error RaiseAlreadyExists(string raiseId); // 0xa7bb9fe0\n    error RaiseDoesNotExists(string raiseId); // 0x78134459\n    error RaiseNotActive(string raiseId, uint256 currentTime); // 0x251061ff\n    error RaiseNotFailed(string raiseId); // 0x1e45b786\n    error RaiseNotSucceed(string raiseId); // 0x3925f3e4\n    error RaiseAlreadyFinished(string raiseId); // 0x0287eafc\n\n    // -----------------------------------------------------------------------\n    //                              Softcap / Hardcap\n    // -----------------------------------------------------------------------\n\n    error HardcapAchieved(string raiseId); // 0x8e144f11\n\n    // -----------------------------------------------------------------------\n    //                              Reclaim\n    // -----------------------------------------------------------------------\n\n    error NothingToReclaim(string raiseId); // 0xf803caaa\n    error AlreadyReclaimed(string raiseId); // 0x5ab9f7ef\n\n    // -----------------------------------------------------------------------\n    //                              Refund\n    // -----------------------------------------------------------------------\n\n    error UserHasNotInvested(address sender, string raiseId); // 0xf2ed8df2\n    error CallerNotStartup(address sender, string raiseId); // 0x73810657\n    error InvestorAlreadyRefunded(address sender, string raiseId); // 0x2eff5e61\n    error CollateralAlreadyRefunded(string raiseId); // 0xc4543938\n}\n"
      },
      "src/fundraising/node_modules/@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n    /**\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n\n    /**\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"
      },
      "src/fundraising/node_modules/@openzeppelin/contracts/utils/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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     *\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://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return 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(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (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"
      },
      "src/fundraising/node_modules/@openzeppelin/contracts/utils/Strings.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.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 `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"
      },
      "src/fundraising/node_modules/@openzeppelin/contracts/access/IAccessControl.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted signaling this.\n     *\n     * _Available since v3.1._\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call, an admin role\n     * bearer except when using {AccessControl-_setupRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external view returns (bool);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) external;\n}\n"
      },
      "src/fundraising/node_modules/@openzeppelin/contracts/utils/math/Math.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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(\n        uint256 x,\n        uint256 y,\n        uint256 denominator\n    ) 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                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2^256. Also prevents denominator == 0.\n            require(denominator > prod1);\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(\n        uint256 x,\n        uint256 y,\n        uint256 denominator,\n        Rounding rounding\n    ) 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 10, 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 * 8) < value ? 1 : 0);\n        }\n    }\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "@openzeppelin/=src/fundraising/node_modules/@openzeppelin/",
        "ds-test/=src/fundraising/node_modules/ds-test/src/",
        "forge-std/=src/fundraising/node_modules/forge-std/src/",
        "layer-zero/=src/fundraising/node_modules/layer-zero/",
        "murky/=src/fundraising/node_modules/murky/",
        "stringutils/=node_modules/stringutils/src/",
        "permit2/=node_modules/permit2/src/",
        "openzeppelin-contracts/=src/fundraising/node_modules/murky/lib/openzeppelin-contracts/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 200,
        "details": {
          "yul": false
        }
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "viaIR": true,
      "libraries": {}
    }
  }}