creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/fundraising/contracts/fundraising/initializers/utils/FundraisingAdminTransfer.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 { AccessTypes } from \"../../structs/AccessTypes.sol\";\nimport { LibAccessControl } from \"../../libraries/storage/utils/LibAccessControl.sol\";\nimport { LibLayerZeroSender } from \"../../libraries/storage/cross-chain/layer-zero/LibLayerZeroSender.sol\";\nimport { LibDiamond } from \"../../../diamond/libraries/LibDiamond.sol\";\n\n/**************************************\n\n    Fundraising admin transfer\n\n **************************************/\n\n/// @dev Initializer that transfers admin role for fundraising.\ncontract FundraisingAdminTransfer {\n    // -----------------------------------------------------------------------\n    //                              Structs\n    // -----------------------------------------------------------------------\n\n    /// @dev Args for initializer.\n    /// @param receiver Address of new admin\n    struct Arguments {\n        address receiver;\n        bool diamondOwner;\n        bool adminRole;\n        bool lzRefund;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Functions\n    // -----------------------------------------------------------------------\n\n    /// @dev External init function for a delegate call.\n    /// @dev _args Arguments struct\n    function init(Arguments calldata _args) external {\n        // transfer diamond contract ownership\n        if (_args.diamondOwner) {\n            LibDiamond.setContractOwner(_args.receiver);\n        }\n\n        // transfer admin role\n        if (_args.adminRole) {\n            LibAccessControl.grantRole(LibAccessControl.ADMIN_ROLE, _args.receiver);\n            LibAccessControl.revokeRole(LibAccessControl.ADMIN_ROLE, msg.sender);\n        }\n\n        // transfer lz refund address\n        if (_args.lzRefund) {\n            LibLayerZeroSender.setRefundAddress(_args.receiver);\n        }\n    }\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/libraries/storage/cross-chain/layer-zero/LibLayerZeroSender.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 necessary information for sending messages via LayerZero\nlibrary LibLayerZeroSender {\n    // -----------------------------------------------------------------------\n    //                              Storage pointer\n    // -----------------------------------------------------------------------\n\n    /// @dev Raise storage pointer.\n    bytes32 internal constant LZ_SENDER_STORAGE_POSITION = keccak256(\"angelblock.cc.lz.sender\");\n\n    // -----------------------------------------------------------------------\n    //                              Structs\n    // -----------------------------------------------------------------------\n\n    /// @dev LayerZero sender struct.\n    /// @param refundAddress Refund address\n    /// @param networks Mapping of native network id to LZ network id for supported networks\n    struct LayerZeroSenderStorage {\n        address refundAddress;\n        mapping(uint256 => uint16) networks;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Storage\n    // -----------------------------------------------------------------------\n\n    // diamond storage getter\n    function lzSenderStorage() internal pure returns (LayerZeroSenderStorage storage lzs) {\n        // declare position\n        bytes32 position = LZ_SENDER_STORAGE_POSITION;\n\n        // set slot to position\n        assembly {\n            lzs.slot := position\n        }\n\n        // explicit return\n        return lzs;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Getters / setters\n    // -----------------------------------------------------------------------\n\n    /// @dev Diamond storage getter: refund address.\n    /// @return Refund address\n    function getRefundAddress() internal view returns (address) {\n        // return\n        return lzSenderStorage().refundAddress;\n    }\n\n    /// @dev Diamond storage getter: network.\n    /// @param _nativeChainId Native chain id for given network\n    /// @return LayerZero network id\n    function getNetwork(uint256 _nativeChainId) internal view returns (uint16) {\n        // return\n        return lzSenderStorage().networks[_nativeChainId];\n    }\n\n    /// @dev Diamond storage setter: refund address.\n    /// @param _refundAddress New refund address for LayerZero calls\n    function setRefundAddress(address _refundAddress) internal {\n        lzSenderStorage().refundAddress = _refundAddress;\n    }\n\n    /// @dev Diamond storage setter: network.\n    /// @param _nativeChainId Native chain id\n    /// @param _layerZeroChainId Network chain id in LayerZero format\n    function setNetwork(uint256 _nativeChainId, uint16 _layerZeroChainId) internal {\n        lzSenderStorage().networks[_nativeChainId] = _layerZeroChainId;\n    }\n}\n"
      },
      "src/fundraising/contracts/diamond/libraries/LibDiamond.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// Diamond imports\nimport { IDiamondCut } from \"../interfaces/IDiamondCut.sol\";\n\n/**************************************\n\n    Diamond library (EIP-2535)\n\n    ------------------------------\n\n    @author Nick Mudge\n\n **************************************/\n\n/// @notice Main library with core logic for Diamond Proxy.\nlibrary LibDiamond {\n    // -----------------------------------------------------------------------\n    //                              Storage pointer\n    // -----------------------------------------------------------------------\n\n    bytes32 internal constant DIAMOND_STORAGE_POSITION = keccak256(\"diamond.standard.diamond.storage\");\n\n    // -----------------------------------------------------------------------\n    //                              Structs\n    // -----------------------------------------------------------------------\n\n    /// @dev struct holding facet address and selector position\n    /// @param facetAddress address of facet\n    /// @param functionSelectorPosition position in facetFunctionSelectors.functionSelectors array\n    struct FacetAddressAndPosition {\n        address facetAddress;\n        uint16 functionSelectorPosition;\n    }\n\n    /// @dev struct holding facet selectors and address position\n    /// @param functionSelectors list of function selectors for facet\n    /// @param facetAddressPosition position of facetAddress in facetAddresses array\n    struct FacetFunctionSelectors {\n        bytes4[] functionSelectors;\n        uint16 facetAddressPosition;\n    }\n\n    /// @dev diamond storage struct\n    /// @param selectorToFacetAndPosition maps function selector in the facetFunctionSelectors.selectors array\n    /// @param facetFunctionSelectors maps facet addresses to function selectors\n    /// @param facetAddresses facet addresses\n    /// @param supportedInterfaces Used to query if a contract implements an interface (ERC-165)\n    /// @param contractOwner owner of the contract\n    struct DiamondStorage {\n        mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition;\n        mapping(address => FacetFunctionSelectors) facetFunctionSelectors;\n        address[] facetAddresses;\n        mapping(bytes4 => bool) supportedInterfaces;\n        address contractOwner;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Events\n    // -----------------------------------------------------------------------\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n    event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);\n\n    // -----------------------------------------------------------------------\n    //                              Storage\n    // -----------------------------------------------------------------------\n\n    /// @dev function returning diamond storage at storage pointer slot\n    /// @return ds DiamondStorage struct instance at storage pointer position\n    function diamondStorage() internal pure returns (DiamondStorage storage ds) {\n        bytes32 position = DIAMOND_STORAGE_POSITION;\n        assembly {\n            ds.slot := position\n        }\n        return ds;\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Ownership section\n    // -----------------------------------------------------------------------\n\n    function setContractOwner(address _newOwner) internal {\n        DiamondStorage storage ds = diamondStorage();\n        address previousOwner = ds.contractOwner;\n        ds.contractOwner = _newOwner;\n        emit OwnershipTransferred(previousOwner, _newOwner);\n    }\n\n    function contractOwner() internal view returns (address contractOwner_) {\n        contractOwner_ = diamondStorage().contractOwner;\n    }\n\n    function enforceIsContractOwner() internal view {\n        require(msg.sender == diamondStorage().contractOwner, \"LibDiamond: Must be contract owner\");\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Diamond cut section\n    // -----------------------------------------------------------------------\n\n    // Internal function version of diamondCut\n    function diamondCut(IDiamondCut.FacetCut[] memory _diamondCut, address _init, bytes memory _calldata) internal {\n        for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {\n            IDiamondCut.FacetCutAction action = _diamondCut[facetIndex].action;\n            if (action == IDiamondCut.FacetCutAction.Add) {\n                addFunctions(_diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors);\n            } else if (action == IDiamondCut.FacetCutAction.Replace) {\n                replaceFunctions(_diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors);\n            } else if (action == IDiamondCut.FacetCutAction.Remove) {\n                removeFunctions(_diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors);\n            } else {\n                revert(\"LibDiamondCut: Incorrect FacetCutAction\");\n            }\n        }\n        emit DiamondCut(_diamondCut, _init, _calldata);\n        initializeDiamondCut(_init, _calldata);\n    }\n\n    function addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {\n        require(_functionSelectors.length > 0, \"LibDiamondCut: No selectors in facet to cut\");\n        DiamondStorage storage ds = diamondStorage();\n        // uint16 selectorCount = uint16(diamondStorage().selectors.length);\n        require(_facetAddress != address(0), \"LibDiamondCut: Add facet can't be address(0)\");\n        uint16 selectorPosition = uint16(ds.facetFunctionSelectors[_facetAddress].functionSelectors.length);\n        // add new facet address if it does not exist\n        if (selectorPosition == 0) {\n            enforceHasContractCode(_facetAddress, \"LibDiamondCut: New facet has no code\");\n            ds.facetFunctionSelectors[_facetAddress].facetAddressPosition = uint16(ds.facetAddresses.length);\n            ds.facetAddresses.push(_facetAddress);\n        }\n\n        for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {\n            bytes4 selector = _functionSelectors[selectorIndex];\n            address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;\n            require(oldFacetAddress == address(0), \"LibDiamondCut: Can't add function that already exists\");\n            ds.facetFunctionSelectors[_facetAddress].functionSelectors.push(selector);\n            ds.selectorToFacetAndPosition[selector].facetAddress = _facetAddress;\n            ds.selectorToFacetAndPosition[selector].functionSelectorPosition = selectorPosition;\n            selectorPosition++;\n        }\n    }\n\n    function replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {\n        require(_functionSelectors.length > 0, \"LibDiamondCut: No selectors in facet to cut\");\n        DiamondStorage storage ds = diamondStorage();\n        require(_facetAddress != address(0), \"LibDiamondCut: Add facet can't be address(0)\");\n        uint16 selectorPosition = uint16(ds.facetFunctionSelectors[_facetAddress].functionSelectors.length);\n        // add new facet address if it does not exist\n        if (selectorPosition == 0) {\n            enforceHasContractCode(_facetAddress, \"LibDiamondCut: New facet has no code\");\n            ds.facetFunctionSelectors[_facetAddress].facetAddressPosition = uint16(ds.facetAddresses.length);\n            ds.facetAddresses.push(_facetAddress);\n        }\n        for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {\n            bytes4 selector = _functionSelectors[selectorIndex];\n            address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;\n            require(oldFacetAddress != _facetAddress, \"LibDiamondCut: Can't replace function with same function\");\n            removeFunction(oldFacetAddress, selector);\n            // add function\n            ds.selectorToFacetAndPosition[selector].functionSelectorPosition = selectorPosition;\n            ds.facetFunctionSelectors[_facetAddress].functionSelectors.push(selector);\n            ds.selectorToFacetAndPosition[selector].facetAddress = _facetAddress;\n            selectorPosition++;\n        }\n    }\n\n    function removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {\n        require(_functionSelectors.length > 0, \"LibDiamondCut: No selectors in facet to cut\");\n        DiamondStorage storage ds = diamondStorage();\n        // if function does not exist then do nothing and return\n        require(_facetAddress == address(0), \"LibDiamondCut: Remove facet address must be address(0)\");\n        for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {\n            bytes4 selector = _functionSelectors[selectorIndex];\n            address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;\n            removeFunction(oldFacetAddress, selector);\n        }\n    }\n\n    function removeFunction(address _facetAddress, bytes4 _selector) internal {\n        DiamondStorage storage ds = diamondStorage();\n        require(_facetAddress != address(0), \"LibDiamondCut: Can't remove function that doesn't exist\");\n        // an immutable function is a function defined directly in a diamond\n        require(_facetAddress != address(this), \"LibDiamondCut: Can't remove immutable function\");\n        // replace selector with last selector, then delete last selector\n        uint256 selectorPosition = ds.selectorToFacetAndPosition[_selector].functionSelectorPosition;\n        uint256 lastSelectorPosition = ds.facetFunctionSelectors[_facetAddress].functionSelectors.length - 1;\n        // if not the same then replace _selector with lastSelector\n        if (selectorPosition != lastSelectorPosition) {\n            bytes4 lastSelector = ds.facetFunctionSelectors[_facetAddress].functionSelectors[lastSelectorPosition];\n            ds.facetFunctionSelectors[_facetAddress].functionSelectors[selectorPosition] = lastSelector;\n            ds.selectorToFacetAndPosition[lastSelector].functionSelectorPosition = uint16(selectorPosition);\n        }\n        // delete the last selector\n        ds.facetFunctionSelectors[_facetAddress].functionSelectors.pop();\n        delete ds.selectorToFacetAndPosition[_selector];\n\n        // if no more selectors for facet address then delete the facet address\n        if (lastSelectorPosition == 0) {\n            // replace facet address with last facet address and delete last facet address\n            uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1;\n            uint256 facetAddressPosition = ds.facetFunctionSelectors[_facetAddress].facetAddressPosition;\n            if (facetAddressPosition != lastFacetAddressPosition) {\n                address lastFacetAddress = ds.facetAddresses[lastFacetAddressPosition];\n                ds.facetAddresses[facetAddressPosition] = lastFacetAddress;\n                ds.facetFunctionSelectors[lastFacetAddress].facetAddressPosition = uint16(facetAddressPosition);\n            }\n            ds.facetAddresses.pop();\n            delete ds.facetFunctionSelectors[_facetAddress].facetAddressPosition;\n        }\n    }\n\n    // -----------------------------------------------------------------------\n    //                              Functions\n    // -----------------------------------------------------------------------\n\n    function initializeDiamondCut(address _init, bytes memory _calldata) internal {\n        if (_init == address(0)) {\n            require(_calldata.length == 0, \"LibDiamondCut: _init is address(0) but_calldata is not empty\");\n        } else {\n            require(_calldata.length > 0, \"LibDiamondCut: _calldata is empty but _init is not address(0)\");\n            if (_init != address(this)) {\n                enforceHasContractCode(_init, \"LibDiamondCut: _init address has no code\");\n            }\n            (bool success, bytes memory error) = _init.delegatecall(_calldata);\n            if (!success) {\n                if (error.length > 0) {\n                    // bubble up the error\n                    revert(string(error));\n                } else {\n                    revert(\"LibDiamondCut: _init function reverted\");\n                }\n            }\n        }\n    }\n\n    function enforceHasContractCode(address _contract, string memory _errorMessage) internal view {\n        uint256 contractSize;\n        assembly {\n            contractSize := extcodesize(_contract)\n        }\n        require(contractSize > 0, _errorMessage);\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/contracts/diamond/interfaces/IDiamondCut.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.21;\n\n/**************************************\n\n    Diamond cut interface\n\n    ------------------------------\n\n    @author Nick Mudge\n\n **************************************/\n\ninterface IDiamondCut {\n    // enum\n    enum FacetCutAction {\n        Add,\n        Replace,\n        Remove\n    }\n\n    // struct\n    struct FacetCut {\n        address facetAddress;\n        FacetCutAction action;\n        bytes4[] functionSelectors;\n    }\n\n    // event\n    event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\n\n    /**************************************\n\n        Cut diamond\n\n        ------------------------------\n\n        @notice Add/replace/remove any number of functions and optionally execute a function with delegatecall\n        @param _diamondCut Contains the facet addresses and function selectors\n        @param _init The address of the contract or facet to execute _calldata\n        @param _calldata A function call, including function selector and arguments, that is executed with delegatecall on _init\n\n     **************************************/\n\n    function diamondCut(FacetCut[] calldata _diamondCut, address _init, bytes calldata _calldata) 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/",
        "base58-solidity/=src/fundraising/node_modules/base58-solidity/",
        "ethereum-xcm-v3/=src/fundraising/node_modules/ethereum-xcm-v3/",
        "hardhat/=src/fundraising/node_modules/hardhat/",
        "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",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "viaIR": true,
      "libraries": {}
    }
  }}