{"sources":{"@openzeppelin/contracts/token/ERC20/IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"},"@openzeppelin/contracts/utils/math/Math.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Down, // Toward negative infinity\n        Up, // Toward infinity\n        Zero // Toward zero\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds up instead\n     * of rounding down.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b - 1) / b can overflow on addition, so we distribute.\n        return a == 0 ? 0 : (a - 1) / b + 1;\n    }\n\n    /**\n     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n     * with further edits by Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n            // variables such that product = prod1 * 2^256 + prod0.\n            uint256 prod0; // Least significant 256 bits of the product\n            uint256 prod1; // Most significant 256 bits of the product\n            assembly {\n                let mm := mulmod(x, y, not(0))\n                prod0 := mul(x, y)\n                prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n            }\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (prod1 == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2^256. Also prevents denominator == 0.\n            require(denominator > prod1, \"Math: mulDiv overflow\");\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [prod1 prod0].\n            uint256 remainder;\n            assembly {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                prod1 := sub(prod1, gt(remainder, prod0))\n                prod0 := sub(prod0, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n            // See https://cs.stackexchange.com/q/138556/92363.\n\n            // Does not overflow because the denominator cannot be zero at this stage in the function.\n            uint256 twos = denominator & (~denominator + 1);\n            assembly {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [prod1 prod0] by twos.\n                prod0 := div(prod0, twos)\n\n                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from prod1 into prod0.\n            prod0 |= prod1 * twos;\n\n            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv = 1 mod 2^4.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n            // in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2^8\n            inverse *= 2 - denominator * inverse; // inverse mod 2^16\n            inverse *= 2 - denominator * inverse; // inverse mod 2^32\n            inverse *= 2 - denominator * inverse; // inverse mod 2^64\n            inverse *= 2 - denominator * inverse; // inverse mod 2^128\n            inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n            // is no longer required.\n            result = prod0 * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        uint256 result = mulDiv(x, y, denominator);\n        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n            result += 1;\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n     *\n     * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        if (a == 0) {\n            return 0;\n        }\n\n        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n        //\n        // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n        //\n        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n        //\n        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n        uint256 result = 1 << (log2(a) >> 1);\n\n        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n        // into the expected uint128 result.\n        unchecked {\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            return min(result, a / result);\n        }\n    }\n\n    /**\n     * @notice Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 128;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 64;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 32;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 16;\n            }\n            if (value >> 8 > 0) {\n                value >>= 8;\n                result += 8;\n            }\n            if (value >> 4 > 0) {\n                value >>= 4;\n                result += 4;\n            }\n            if (value >> 2 > 0) {\n                value >>= 2;\n                result += 2;\n            }\n            if (value >> 1 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 16;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 8;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 4;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 2;\n            }\n            if (value >> 8 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n        }\n    }\n}\n"},"@openzeppelin/contracts/utils/math/SafeMath.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)\n\npragma solidity ^0.8.0;\n\n// CAUTION\n// This version of SafeMath should only be used with Solidity 0.8 or later,\n// because it relies on the compiler's built in overflow checks.\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations.\n *\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\n * now has built in overflow checking.\n */\nlibrary SafeMath {\n    /**\n     * @dev Returns the addition of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            uint256 c = a + b;\n            if (c < a) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b > a) return (false, 0);\n            return (true, a - b);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n            // benefit is lost if 'b' is also tested.\n            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n            if (a == 0) return (true, 0);\n            uint256 c = a * b;\n            if (c / a != b) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a division by zero flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a / b);\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a % b);\n        }\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `+` operator.\n     *\n     * Requirements:\n     *\n     * - Addition cannot overflow.\n     */\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a + b;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a - b;\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `*` operator.\n     *\n     * Requirements:\n     *\n     * - Multiplication cannot overflow.\n     */\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a * b;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers, reverting on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator.\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a / b;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * reverting when dividing by zero.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a % b;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n     * overflow (when the result is negative).\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {trySub}.\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        unchecked {\n            require(b <= a, errorMessage);\n            return a - b;\n        }\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        unchecked {\n            require(b > 0, errorMessage);\n            return a / b;\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * reverting with custom message when dividing by zero.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryMod}.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        unchecked {\n            require(b > 0, errorMessage);\n            return a % b;\n        }\n    }\n}\n"},"contracts/compliance/IDSComplianceConfigurationService.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"../utils/VersionedContract.sol\";\nimport \"../utils/Initializable.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSComplianceConfigurationService is Initializable, VersionedContract {\n\n    function initialize() public virtual {\n        VERSIONS.push(7);\n    }\n\n    event DSComplianceUIntRuleSet(string ruleName, uint256 prevValue, uint256 newValue);\n    event DSComplianceBoolRuleSet(string ruleName, bool prevValue, bool newValue);\n    event DSComplianceStringToUIntMapRuleSet(string ruleName, string keyValue, uint256 prevValue, uint256 newValue);\n\n    function getCountryCompliance(string memory _country) public view virtual returns (uint256);\n\n    function setCountriesCompliance(string[] memory _countries, uint256[] memory _values) public virtual;\n\n    function setCountryCompliance(\n        string memory _country,\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getTotalInvestorsLimit() public view virtual returns (uint256);\n\n    function setTotalInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMinUSTokens() public view virtual returns (uint256);\n\n    function setMinUSTokens(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMinEUTokens() public view virtual returns (uint256);\n\n    function setMinEUTokens(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getUSInvestorsLimit() public view virtual returns (uint256);\n\n    function setUSInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getJPInvestorsLimit() public view virtual returns (uint256);\n\n    function setJPInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getUSAccreditedInvestorsLimit() public view virtual returns (uint256);\n\n    function setUSAccreditedInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getNonAccreditedInvestorsLimit() public view virtual returns (uint256);\n\n    function setNonAccreditedInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMaxUSInvestorsPercentage() public view virtual returns (uint256);\n\n    function setMaxUSInvestorsPercentage(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getBlockFlowbackEndTime() public view virtual returns (uint256);\n\n    function setBlockFlowbackEndTime(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getNonUSLockPeriod() public view virtual returns (uint256);\n\n    function setNonUSLockPeriod(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMinimumTotalInvestors() public view virtual returns (uint256);\n\n    function setMinimumTotalInvestors(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMinimumHoldingsPerInvestor() public view virtual returns (uint256);\n\n    function setMinimumHoldingsPerInvestor(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMaximumHoldingsPerInvestor() public view virtual returns (uint256);\n\n    function setMaximumHoldingsPerInvestor(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getEURetailInvestorsLimit() public view virtual returns (uint256);\n\n    function setEURetailInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getUSLockPeriod() public view virtual returns (uint256);\n\n    function setUSLockPeriod(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getForceFullTransfer() public view virtual returns (bool);\n\n    function setForceFullTransfer(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getForceAccredited() public view virtual returns (bool);\n\n    function setForceAccredited(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function setForceAccreditedUS(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getForceAccreditedUS() public view virtual returns (bool);\n\n    function setWorldWideForceFullTransfer(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getWorldWideForceFullTransfer() public view virtual returns (bool);\n\n    function getAuthorizedSecurities() public view virtual returns (uint256);\n\n    function setAuthorizedSecurities(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getDisallowBackDating() public view virtual returns (bool);\n\n    function setDisallowBackDating(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function setAll(\n        uint256[] memory _uint_values,\n        bool[] memory _bool_values /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getAll() public view virtual returns (uint256[] memory, bool[] memory);\n}\n"},"contracts/compliance/IDSComplianceService.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"../utils/VersionedContract.sol\";\nimport \"../utils/Initializable.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSComplianceService is Initializable, VersionedContract {\n\n    function initialize() public virtual {\n        VERSIONS.push(7);\n    }\n\n    uint256 internal constant NONE = 0;\n    uint256 internal constant US = 1;\n    uint256 internal constant EU = 2;\n    uint256 internal constant FORBIDDEN = 4;\n    uint256 internal constant JP = 8;\n    string internal constant TOKEN_PAUSED = \"Token Paused\";\n    string internal constant NOT_ENOUGH_TOKENS = \"Not Enough Tokens\";\n    string internal constant TOKENS_LOCKED = \"Tokens Locked\";\n    string internal constant WALLET_NOT_IN_REGISTRY_SERVICE = \"Wallet not in registry Service\";\n    string internal constant DESTINATION_RESTRICTED = \"Destination restricted\";\n    string internal constant VALID = \"Valid\";\n    string internal constant HOLD_UP = \"Under lock-up\";\n    string internal constant ONLY_FULL_TRANSFER = \"Only Full Transfer\";\n    string internal constant FLOWBACK = \"Flowback\";\n    string internal constant MAX_INVESTORS_IN_CATEGORY = \"Max Investors in category\";\n    string internal constant AMOUNT_OF_TOKENS_UNDER_MIN = \"Amount of tokens under min\";\n    string internal constant AMOUNT_OF_TOKENS_ABOVE_MAX = \"Amount of tokens above max\";\n    string internal constant ONLY_ACCREDITED = \"Only accredited\";\n    string internal constant ONLY_US_ACCREDITED = \"Only us accredited\";\n    string internal constant NOT_ENOUGH_INVESTORS = \"Not enough investors\";\n    string internal constant MAX_AUTHORIZED_SECURITIES_EXCEEDED = \"Max authorized securities exceeded\";\n\n    function adjustInvestorCountsAfterCountryChange(\n        string memory _id,\n        string memory _country,\n        string memory _prevCountry\n    ) public virtual returns (bool);\n\n    //*****************************************\n    // TOKEN ACTION VALIDATIONS\n    //*****************************************\n\n    function validateTransfer(\n        address _from,\n        address _to,\n        uint256 _value /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function validateTransfer(\n        address _from,\n        address _to,\n        uint256 _value, /*onlyToken*/\n        bool _pausedToken,\n        uint256 _balanceFrom\n    ) public virtual returns (bool);\n\n    function validateIssuance(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function validateIssuanceWithNoCompliance(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function validateBurn(\n        address _who,\n        uint256 _value /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function validateSeize(\n        address _from,\n        address _to,\n        uint256 _value /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function preIssuanceCheck(address _to, uint256 _value) public view virtual returns (uint256 code, string memory reason);\n\n    function preTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual returns (uint256 code, string memory reason);\n\n    function preInternalTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual returns (uint256 code, string memory reason);\n\n    function validateIssuanceTime(uint256 _issuanceTime) public view virtual returns (uint256 issuanceTime);\n}\n"},"contracts/compliance/IDSComplianceServicePartitioned.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"./IDSComplianceService.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSComplianceServicePartitioned is IDSComplianceService {\n\n    function initialize() public virtual override {\n        VERSIONS.push(2);\n    }\n\n    function getComplianceTransferableTokens(\n        address _who,\n        uint256 _time,\n        bool _checkFlowback\n    ) public view virtual returns (uint256 transferable);\n\n    function getComplianceTransferableTokens(\n        address _who,\n        uint256 _time,\n        bool _checkFlowback,\n        bytes32 _partition\n    ) public view virtual returns (uint256);\n\n    function getComplianceTransferableTokens(\n        address _who,\n        uint256 _time,\n        address _to\n    ) public view virtual returns (uint256 transferable);\n\n    function getComplianceTransferableTokens(\n        address _who,\n        uint256 _time,\n        address _to,\n        bytes32 _partition\n    ) public view virtual returns (uint256);\n}\n"},"contracts/compliance/IDSLockManager.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"../utils/VersionedContract.sol\";\nimport \"../utils/Initializable.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSLockManager is Initializable, VersionedContract {\n\n    function initialize() public virtual;\n\n    modifier validLock(uint256 _valueLocked, uint256 _releaseTime) {\n        require(_valueLocked > 0, \"Value is zero\");\n        require(_releaseTime == 0 || _releaseTime > uint256(block.timestamp), \"Release time is in the past\");\n        _;\n    }\n\n    event Locked(address indexed who, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime);\n    event Unlocked(address indexed who, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime);\n\n    event HolderLocked(string holderId, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime);\n    event HolderUnlocked(string holderId, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime);\n    /**\n     * @dev creates a lock record for wallet address\n     * @param _to address to lock the tokens at\n     * @param _valueLocked value of tokens to lock\n     * @param _reason reason for lock\n     * @param _releaseTime timestamp to release the lock (or 0 for locks which can only released by an unlockTokens call)\n     * Note: The user MAY have at a certain time more locked tokens than actual tokens\n     */\n\n    function addManualLockRecord(\n        address _to,\n        uint256 _valueLocked,\n        string memory _reason,\n        uint256 _releaseTime /*issuerOrAboveOrToken*/\n    ) public virtual;\n\n    /**\n     * @dev creates a lock record for investor Id\n     * @param _investor investor id to lock the tokens at\n     * @param _valueLocked value of tokens to lock\n     * @param _reasonCode reason code for lock\n     * @param _reasonString reason for lock\n     * @param _releaseTime timestamp to release the lock (or 0 for locks which can only released by an unlockTokens call)\n     * Note: The user MAY have at a certain time more locked tokens than actual tokens\n     */\n\n    function createLockForInvestor(\n        string memory _investor,\n        uint256 _valueLocked,\n        uint256 _reasonCode,\n        string memory _reasonString,\n        uint256 _releaseTime /*onlyIssuerOrAboveOrToken*/\n    ) public virtual;\n\n    /**\n     * @dev Releases a specific lock record for a wallet\n     * @param _to address to release the tokens for\n     * @param _lockIndex the index of the lock to remove\n     *\n     * note - this may change the order of the locks on an address, so if iterating the iteration should be restarted.\n     * @return true on success\n     */\n    function removeLockRecord(\n        address _to,\n        uint256 _lockIndex /*issuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Releases a specific lock record for a investor\n     * @param _investorId investor id to release the tokens for\n     * @param _lockIndex the index of the lock to remove\n     *\n     * note - this may change the order of the locks on an address, so if iterating the iteration should be restarted.\n     * @return true on success\n     */\n    function removeLockRecordForInvestor(\n        string memory _investorId,\n        uint256 _lockIndex /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Get number of locks currently associated with an address\n     * @param _who address to get count for\n     *\n     * @return number of locks\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockCount(address _who) public view virtual returns (uint256);\n\n    /**\n     * @dev Get number of locks currently associated with a investor\n     * @param _investorId investor id to get count for\n     *\n     * @return number of locks\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n\n    function lockCountForInvestor(string memory _investorId) public view virtual returns (uint256);\n\n    /**\n     * @dev Get details of a specific lock associated with an address\n     * can be used to iterate through the locks of a user\n     * @param _who address to get token lock for\n     * @param _lockIndex the 0 based index of the lock.\n     * @return reasonCode the reason code\n     * @return reasonString the reason for the lock\n     * @return value the value of tokens locked\n     * @return autoReleaseTime the timestamp in which the lock will be inactive (or 0 if it's always active until removed)\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockInfo(address _who, uint256 _lockIndex) public view virtual returns (uint256 reasonCode, string memory reasonString, uint256 value, uint256 autoReleaseTime);\n\n    /**\n     * @dev Get details of a specific lock associated with a investor\n     * can be used to iterate through the locks of a user\n     * @param _investorId investorId to get token lock for\n     * @param _lockIndex the 0 based index of the lock.\n     * @return reasonCode the reason code\n     * @return reasonString the reason for the lock\n     * @return value the value of tokens locked\n     * @return autoReleaseTime the timestamp in which the lock will be inactive (or 0 if it's always active until removed)\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockInfoForInvestor(\n        string memory _investorId,\n        uint256 _lockIndex\n    ) public view virtual  returns (uint256 reasonCode, string memory reasonString, uint256 value, uint256 autoReleaseTime);\n\n    /**\n     * @dev get total number of transferable tokens for a wallet, at a certain time\n     * @param _who address to get number of transferable tokens for\n     * @param _time time to calculate for\n     */\n    function getTransferableTokens(address _who, uint256 _time) public view virtual returns (uint256);\n\n    /**\n     * @dev get total number of transferable tokens for a investor, at a certain time\n     * @param _investorId investor id\n     * @param _time time to calculate for\n     */\n    function getTransferableTokensForInvestor(string memory _investorId, uint256 _time) public view virtual returns (uint256);\n\n    /**\n     * @dev pause investor\n     * @param _investorId investor id\n     */\n    function lockInvestor(\n        string memory _investorId /*issuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev unpauses investor\n     * @param _investorId investor id\n     */\n    function unlockInvestor(\n        string memory _investorId /*issuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Returns true if paused, otherwise false\n     * @param _investorId investor id\n     */\n    function isInvestorLocked(string memory _investorId) public view virtual returns (bool);\n}\n"},"contracts/compliance/IDSLockManagerPartitioned.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"./IDSLockManager.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSLockManagerPartitioned is Initializable, VersionedContract {\n\n    event LockedPartition(address indexed who, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime, bytes32 indexed partition);\n    event UnlockedPartition(address indexed who, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime, bytes32 indexed partition);\n    event HolderLockedPartition(string investorId, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime, bytes32 indexed partition);\n    event HolderUnlockedPartition(string investorId, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime, bytes32 indexed partition);\n\n    function createLockForInvestor(\n        string memory _investorId,\n        uint256 _valueLocked,\n        uint256 _reasonCode,\n        string memory _reasonString,\n        uint256 _releaseTime,\n        bytes32 _partition\n    ) public virtual;\n\n    function addManualLockRecord(\n        address _to,\n        uint256 _valueLocked,\n        string memory _reason,\n        uint256 _releaseTime,\n        bytes32 _partition /*issuerOrAboveOrToken*/\n    ) public virtual;\n\n    function removeLockRecord(\n        address _to,\n        uint256 _lockIndex,\n        bytes32 _partition /*issuerOrAbove*/\n    ) public virtual returns (bool);\n\n    function removeLockRecordForInvestor(\n        string memory _investorId,\n        uint256 _lockIndex,\n        bytes32 _partition /*issuerOrAbove*/\n    ) public virtual returns (bool);\n\n    function lockCount(address _who, bytes32 _partition) public view virtual returns (uint256);\n\n    function lockInfo(\n        address _who,\n        uint256 _lockIndex,\n        bytes32 _partition\n    )\n        public\n        view\n        virtual\n        returns (\n            uint256 reasonCode,\n            string memory reasonString,\n            uint256 value,\n            uint256 autoReleaseTime\n        );\n\n    function lockCountForInvestor(string memory _investorId, bytes32 _partition) public view virtual returns (uint256);\n\n    function lockInfoForInvestor(\n        string memory _investorId,\n        uint256 _lockIndex,\n        bytes32 _partition\n    )\n        public\n        view\n        virtual\n        returns (\n            uint256 reasonCode,\n            string memory reasonString,\n            uint256 value,\n            uint256 autoReleaseTime\n        );\n\n    function getTransferableTokens(\n        address _who,\n        uint256 _time,\n        bytes32 _partition\n    ) public view virtual returns (uint256);\n\n    function getTransferableTokensForInvestor(\n        string memory _investorId,\n        uint256 _time,\n        bytes32 _partition\n    ) public view virtual returns (uint256);\n\n    /*************** Legacy functions ***************/\n    function createLockForHolder(\n        string memory _investorId,\n        uint256 _valueLocked,\n        uint256 _reasonCode,\n        string memory _reasonString,\n        uint256 _releaseTime,\n        bytes32 _partition\n    ) public virtual;\n\n    function removeLockRecordForHolder(\n        string memory _investorId,\n        uint256 _lockIndex,\n        bytes32 _partition\n    ) public virtual returns (bool);\n\n    function lockCountForHolder(string memory _holderId, bytes32 _partition) public view virtual returns (uint256);\n\n    function lockInfoForHolder(\n        string memory _holderId,\n        uint256 _lockIndex,\n        bytes32 _partition\n    )\n        public\n        view\n        virtual\n        returns (\n            uint256 reasonCode,\n            string memory reasonString,\n            uint256 value,\n            uint256 autoReleaseTime\n        );\n\n    function getTransferableTokensForHolder(\n        string memory _holderId,\n        uint256 _time,\n        bytes32 _partition\n    ) public view virtual returns (uint256);\n\n    /******************************/\n}\n"},"contracts/compliance/IDSPartitionsManager.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"../service/IDSServiceConsumer.sol\";\nimport \"../utils/Initializable.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSPartitionsManager is Initializable, IDSServiceConsumer {\n\n    event PartitionCreated(uint256 _date, uint256 _region, bytes32 _partition);\n\n    function initialize() public virtual override {\n        VERSIONS.push(2);\n    }\n\n    function ensurePartition(\n        uint256 _issuanceDate,\n        uint256 _region /*onlyIssuerOrAboveOrToken*/\n    ) public virtual returns (bytes32 partition);\n\n    function getPartition(bytes32 _partition) public view virtual returns (uint256 date, uint256 region);\n\n    function getPartitionIssuanceDate(bytes32 _partition) public view virtual returns (uint256);\n\n    function getPartitionRegion(bytes32 _partition) public view virtual returns (uint256);\n}\n"},"contracts/compliance/IDSWalletManager.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"../utils/VersionedContract.sol\";\nimport \"../utils/Initializable.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSWalletManager is Initializable, VersionedContract {\n\n    function initialize() public virtual {\n        VERSIONS.push(5);\n    }\n\n    // Special wallets constants\n    uint8 public constant NONE = 0;\n    uint8 public constant ISSUER = 1;\n    uint8 public constant PLATFORM = 2;\n    uint8 public constant EXCHANGE = 4;\n\n    /**\n     * @dev should be emitted when a special wallet is added.\n     */\n    event DSWalletManagerSpecialWalletAdded(address wallet, uint8 walletType, address sender);\n    /**\n     * @dev should be emitted when a special wallet is removed.\n     */\n    event DSWalletManagerSpecialWalletRemoved(address wallet, uint8 walletType, address sender);\n    /**\n     * @dev should be emitted when the number of reserved slots is set for a wallet.\n     */\n    event DSWalletManagerReservedSlotsSet(address wallet, string country, uint8 accreditationStatus, uint256 slots, address sender);\n\n    /**\n     * @dev Sets a wallet to be an special wallet. (internal)\n     * @param _wallet The address of the wallet.\n     * @param _type The type of the wallet.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function setSpecialWallet(address _wallet, uint8 _type) internal virtual returns (bool);\n\n    /**\n     * @dev gets a wallet type\n     * @param _wallet the address of the wallet to check.\n     */\n    function getWalletType(address _wallet) public view virtual returns (uint8);\n\n    /**\n     * @dev Returns true if it is platform wallet\n     * @param _wallet the address of the wallet to check.\n     */\n    function isPlatformWallet(address _wallet) external view virtual returns (bool);\n\n    /**\n     * @dev Returns true if it is special wallet\n     * @param _wallet the address of the wallet to check.\n     */\n    function isSpecialWallet(address _wallet) external view virtual returns (bool);\n\n    /**\n     * @dev Returns true if it is issuer special wallet\n     * @param _wallet the address of the wallet to check.\n     */\n    function isIssuerSpecialWallet(address _wallet) external view virtual returns (bool);\n\n    /**\n     * @dev Sets a wallet to be an issuer wallet.\n     * @param _wallet The address of the wallet.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addIssuerWallet(\n        address _wallet /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Sets an array of wallets to be issuer wallets.\n     * @param _wallets The address of the wallets.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addIssuerWallets(address[] memory _wallets) public virtual returns (bool);\n\n    /**\n     * @dev Sets a wallet to be a platform wallet.\n     * @param _wallet The address of the wallet.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addPlatformWallet(\n        address _wallet /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Sets an array of wallets to be platforms wallet.\n     * @param _wallets The address of the wallets.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addPlatformWallets(address[] memory _wallets) public virtual returns (bool);\n\n    /**\n     * @dev Sets a wallet to be an exchange wallet.\n     * @param _wallet The address of the wallet.\n     * @param _owner The address of the owner.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addExchangeWallet(address _wallet, address _owner) public virtual returns (bool);\n\n    /**\n     * @dev Removes a special wallet.\n     * @param _wallet The address of the wallet.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function removeSpecialWallet(\n        address _wallet /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n}\n"},"contracts/compliance/InvestorLockManager.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"./IDSLockManager.sol\";\nimport \"./InvestorLockManagerBase.sol\";\nimport \"../data-stores/InvestorLockManagerDataStore.sol\";\nimport \"../utils/ProxyTarget.sol\";\nimport \"../service/ServiceConsumer.sol\";\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\ncontract InvestorLockManager is InvestorLockManagerBase {\n    uint256 constant MAX_LOCKS_PER_INVESTOR = 30;\n\n    function initialize() public override initializer forceInitializeFromProxy {\n        InvestorLockManagerBase.initialize();\n\n        VERSIONS.push(3);\n    }\n\n    function setLockInfoImpl(string memory _investor, uint256 _lockIndex, uint256 _valueLocked, uint256 _reasonCode, string memory _reasonString, uint256 _releaseTime) internal {\n        investorsLocks[_investor][_lockIndex] = Lock(_valueLocked, _reasonCode, _reasonString, _releaseTime);\n    }\n\n    function createLockForInvestor(string memory _investor, uint256 _valueLocked, uint256 _reasonCode, string memory _reasonString, uint256 _releaseTime)\n        public\n        override\n        validLock(_valueLocked, _releaseTime)\n        onlyTransferAgentOrAboveOrToken\n    {\n        //Get total count\n        uint256 totalLockCount = investorsLocksCounts[_investor];\n        //Only allow MAX_LOCKS_PER_INVESTOR locks per address, to prevent out-of-gas at transfer scenarios\n        require(totalLockCount < MAX_LOCKS_PER_INVESTOR, \"Too many locks for this investor\");\n        setLockInfoImpl(_investor, totalLockCount, _valueLocked, _reasonCode, _reasonString, _releaseTime);\n        totalLockCount += 1;\n        investorsLocksCounts[_investor] = totalLockCount;\n        emit HolderLocked(_investor, _valueLocked, _reasonCode, _reasonString, _releaseTime);\n    }\n\n    function createLock(address _to, uint256 _valueLocked, uint256 _reasonCode, string memory _reasonString, uint256 _releaseTime) internal {\n        createLockForInvestor(getRegistryService().getInvestor(_to), _valueLocked, _reasonCode, _reasonString, _releaseTime);\n        emit Locked(_to, _valueLocked, _reasonCode, _reasonString, _releaseTime);\n    }\n\n    function addManualLockRecord(address _to, uint256 _valueLocked, string memory _reason, uint256 _releaseTime) public override onlyTransferAgentOrAboveOrToken {\n        require(_to != address(0), \"Invalid address\");\n        createLock(_to, _valueLocked, 0, _reason, _releaseTime);\n    }\n\n    function removeLockRecordForInvestor(string memory _investorId, uint256 _lockIndex) public override onlyTransferAgentOrAbove returns (bool) {\n        emit HolderUnlocked(\n            _investorId,\n            investorsLocks[_investorId][_lockIndex].value,\n            investorsLocks[_investorId][_lockIndex].reason,\n            investorsLocks[_investorId][_lockIndex].reasonString,\n            investorsLocks[_investorId][_lockIndex].releaseTime\n        );\n\n        //Put the last lock instead of the lock to remove (this will work even with 1 lock in the list)\n        uint256 lastLockNumber = investorsLocksCounts[_investorId];\n        require(_lockIndex < lastLockNumber, \"Index is greater than the number of locks\");\n        lastLockNumber -= 1;\n\n        //Move the lock\n        uint256 reasonCode = investorsLocks[_investorId][lastLockNumber].reason;\n        setLockInfoImpl(\n            _investorId,\n            _lockIndex,\n            investorsLocks[_investorId][lastLockNumber].value,\n            reasonCode,\n            investorsLocks[_investorId][lastLockNumber].reasonString,\n            investorsLocks[_investorId][lastLockNumber].releaseTime\n        );\n\n        //delete the last _lock\n        //Remove from reverse index\n        delete investorsLocks[_investorId][lastLockNumber];\n\n        //decrease the lock counter for the user\n        investorsLocksCounts[_investorId] = lastLockNumber;\n\n        return true;\n    }\n\n    /**\n     * @dev Releases a specific lock record\n     * @param _to address to release the tokens for\n     * @param _lockIndex the index of the lock\n     *\n     * note - this may change the order of the locks on an address, so if iterating the iteration should be restarted.\n     * @return true on success\n     */\n    function removeLockRecord(address _to, uint256 _lockIndex) public override onlyTransferAgentOrAbove returns (bool) {\n        require(_to != address(0), \"Invalid address\");\n        string memory investor = getRegistryService().getInvestor(_to);\n        //Emit must be done on start ,because we're going to overwrite this value\n        emit Unlocked(\n            _to,\n            investorsLocks[investor][_lockIndex].value,\n            investorsLocks[investor][_lockIndex].reason,\n            investorsLocks[investor][_lockIndex].reasonString,\n            investorsLocks[investor][_lockIndex].releaseTime\n        );\n        removeLockRecordForInvestor(investor, _lockIndex);\n\n        return true;\n    }\n\n    /**\n     * @dev Get number of locks currently associated with an address\n     * @param _who address to get token lock for\n     *\n     * @return number of locks\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockCount(address _who) public view override returns (uint256) {\n        require(_who != address(0), \"Invalid address\");\n        string memory investor = getRegistryService().getInvestor(_who);\n        return investorsLocksCounts[investor];\n    }\n\n    function lockCountForInvestor(string memory _investorId) public view override returns (uint256) {\n        return investorsLocksCounts[_investorId];\n    }\n\n    /**\n     * @dev Get details of a specific lock associated with an address\n     * can be used to iterate through the locks of a user\n     * @return reasonCode the reason code for the lock\n     * @return reasonString the reason for the lock\n     * @return value the value of tokens locked\n     * @return autoReleaseTime the timestamp in which the lock will be inactive (or 0 if it's always active until removed)\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockInfo(address _who, uint256 _lockIndex) public view override returns (uint256 reasonCode, string memory reasonString, uint256 value, uint256 autoReleaseTime) {\n        require(_who != address(0), \"Invalid address\");\n        string memory investor = getRegistryService().getInvestor(_who);\n        return lockInfoForInvestor(investor, _lockIndex);\n    }\n\n    function lockInfoForInvestor(string memory _investorId, uint256 _lockIndex)\n        public\n        view\n        override\n        returns (uint256 reasonCode, string memory reasonString, uint256 value, uint256 autoReleaseTime)\n    {\n        uint256 lastLockNumber = investorsLocksCounts[_investorId];\n        require(_lockIndex < lastLockNumber, \"Index is greater than the number of locks\");\n        reasonCode = investorsLocks[_investorId][_lockIndex].reason;\n        reasonString = investorsLocks[_investorId][_lockIndex].reasonString;\n        value = investorsLocks[_investorId][_lockIndex].value;\n        autoReleaseTime = investorsLocks[_investorId][_lockIndex].releaseTime;\n    }\n\n    function getTransferableTokens(address _who, uint256 _time) public view override returns (uint256) {\n        string memory investor = getRegistryService().getInvestor(_who);\n        return getTransferableTokensForInvestor(investor, _time);\n    }\n\n    function getTransferableTokensForInvestor(string memory _investorId, uint256 _time) public view override returns (uint256) {\n        require(_time > 0, \"Time must be greater than zero\");\n        if (investorsLocked[_investorId]) {\n            return 0;\n        }\n\n        uint256 balanceOfInvestor = getToken().balanceOfInvestor(_investorId);\n        uint256 investorLockCount = investorsLocksCounts[_investorId];\n\n        //No locks, go to base class implementation\n        if (investorLockCount == 0) {\n            return balanceOfInvestor;\n        }\n\n        uint256 totalLockedTokens = 0;\n        for (uint256 i = 0; i < investorLockCount; i++) {\n            uint256 autoReleaseTime = investorsLocks[_investorId][i].releaseTime;\n\n            if (autoReleaseTime == 0 || autoReleaseTime > _time) {\n                totalLockedTokens = totalLockedTokens + investorsLocks[_investorId][i].value;\n            }\n        }\n\n        //there may be more locked tokens than actual tokens, so the minimum between the two\n        uint256 transferable = SafeMath.sub(balanceOfInvestor, Math.min(totalLockedTokens, balanceOfInvestor));\n\n        return transferable;\n    }\n}\n"},"contracts/compliance/InvestorLockManagerBase.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"../data-stores/InvestorLockManagerDataStore.sol\";\nimport \"../utils/ProxyTarget.sol\";\nimport \"../service/ServiceConsumer.sol\";\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract InvestorLockManagerBase is ProxyTarget, IDSLockManager, ServiceConsumer, InvestorLockManagerDataStore {\n    event InvestorFullyLocked(string investorId);\n    event InvestorFullyUnlocked(string investorId);\n\n    function initialize() public virtual override(IDSLockManager, ServiceConsumer) {\n        ServiceConsumer.initialize();\n        VERSIONS.push(1);\n    }\n\n    function lockInvestor(string memory _investorId) public override onlyTransferAgentOrAbove returns (bool) {\n        require(!investorsLocked[_investorId], \"Investor is already locked\");\n        investorsLocked[_investorId] = true;\n        emit InvestorFullyLocked(_investorId);\n        return true;\n    }\n\n    function unlockInvestor(string memory _investorId) public override onlyTransferAgentOrAbove returns (bool) {\n        require(investorsLocked[_investorId], \"Investor is not locked\");\n        delete investorsLocked[_investorId];\n        emit InvestorFullyUnlocked(_investorId);\n        return true;\n    }\n\n    function isInvestorLocked(string memory _investorId) public override view returns (bool) {\n        return investorsLocked[_investorId];\n    }\n}\n"},"contracts/data-stores/BaseLockManagerDataStore.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"./ServiceConsumerDataStore.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\ncontract BaseLockManagerDataStore is ServiceConsumerDataStore {\n    struct Lock {\n        uint256 value;\n        uint256 reason;\n        string reasonString;\n        uint256 releaseTime;\n    }\n}\n"},"contracts/data-stores/InvestorLockManagerDataStore.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"./BaseLockManagerDataStore.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\ncontract InvestorLockManagerDataStore is BaseLockManagerDataStore {\n    mapping(string => mapping(uint256 => Lock)) internal investorsLocks;\n    mapping(string => uint256) internal investorsLocksCounts;\n    mapping(string => bool) internal investorsLocked;\n    mapping(string => mapping(bytes32 => mapping(uint256 => Lock))) internal investorsPartitionsLocks;\n    mapping(string => mapping(bytes32 => uint256)) internal investorsPartitionsLocksCounts;\n}\n"},"contracts/data-stores/OmnibusTBEControllerDataStore.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"./ServiceConsumerDataStore.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\ncontract OmnibusTBEControllerDataStore is ServiceConsumerDataStore {\n    address internal omnibusWallet;\n    bool internal isPartitionedToken;\n}\n"},"contracts/data-stores/ServiceConsumerDataStore.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\ncontract ServiceConsumerDataStore {\n    using SafeMath for uint256;\n\n    mapping(uint256 => address) internal services;\n}\n"},"contracts/omnibus/IDSOmnibusTBEController.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"../service/ServiceConsumer.sol\";\nimport \"../utils/ProxyTarget.sol\";\nimport \"../data-stores/OmnibusTBEControllerDataStore.sol\";\nimport \"../utils/VersionedContract.sol\";\nimport \"../utils/Initializable.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSOmnibusTBEController is Initializable, VersionedContract {\n    using SafeMath for uint256;\n\n    function initialize(address _omnibusWallet, bool _isPartitionedToken) public virtual;\n\n    function bulkIssuance(uint256 value, uint256 issuanceTime, uint256 totalInvestors, uint256 accreditedInvestors,\n        uint256 usAccreditedInvestors, uint256 usTotalInvestors, uint256 jpTotalInvestors, bytes32[] memory euRetailCountries,\n        uint256[] memory euRetailCountryCounts) public virtual;\n\n    function bulkBurn(uint256 value, uint256 totalInvestors, uint256 accreditedInvestors,\n        uint256 usAccreditedInvestors, uint256 usTotalInvestors, uint256 jpTotalInvestors, bytes32[] memory euRetailCountries,\n        uint256[] memory euRetailCountryCounts) public virtual;\n\n    function bulkTransfer(address[] memory wallets, uint256[] memory values) public virtual;\n\n    function adjustCounters(int256 totalDelta, int256 accreditedDelta,\n        int256 usAccreditedDelta, int256 usTotalDelta, int256 jpTotalDelta, bytes32[] memory euRetailCountries,\n        int256[] memory euRetailCountryDeltas) public virtual;\n\n    function getOmnibusWallet() public view virtual returns (address);\n}\n"},"contracts/omnibus/IDSOmnibusWalletController.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"../utils/VersionedContract.sol\";\nimport \"../utils/Initializable.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSOmnibusWalletController is Initializable, VersionedContract {\n    uint8 public constant BENEFICIARY = 0;\n    uint8 public constant HOLDER_OF_RECORD = 1;\n\n    function initialize(address _omnibusWallet) public virtual;\n\n    function setAssetTrackingMode(uint8 _assetTrackingMode) public virtual;\n\n    function getAssetTrackingMode() public view virtual returns (uint8);\n\n    function isHolderOfRecord() public view virtual returns (bool);\n\n    function balanceOf(address _who) public view virtual returns (uint256);\n\n    function transfer(\n        address _from,\n        address _to,\n        uint256 _value /*onlyOperator*/\n    ) public virtual;\n\n    function deposit(\n        address _to,\n        uint256 _value /*onlyToken*/\n    ) public virtual;\n\n    function withdraw(\n        address _from,\n        uint256 _value /*onlyToken*/\n    ) public virtual;\n\n    function seize(\n        address _from,\n        uint256 _value /*onlyToken*/\n    ) public virtual;\n\n    function burn(\n        address _from,\n        uint256 _value /*onlyToken*/\n    ) public virtual;\n}\n"},"contracts/registry/IDSRegistryService.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"../utils/CommonUtils.sol\";\nimport \"../utils/VersionedContract.sol\";\nimport \"../utils/Initializable.sol\";\nimport \"../omnibus/IDSOmnibusWalletController.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSRegistryService is Initializable, VersionedContract {\n\n    function initialize() public virtual {\n        VERSIONS.push(6);\n    }\n\n    event DSRegistryServiceInvestorAdded(string investorId, address sender);\n    event DSRegistryServiceInvestorRemoved(string investorId, address sender);\n    event DSRegistryServiceInvestorCountryChanged(string investorId, string country, address sender);\n    event DSRegistryServiceInvestorAttributeChanged(string investorId, uint256 attributeId, uint256 value, uint256 expiry, string proofHash, address sender);\n    event DSRegistryServiceWalletAdded(address wallet, string investorId, address sender);\n    event DSRegistryServiceWalletRemoved(address wallet, string investorId, address sender);\n    event DSRegistryServiceOmnibusWalletAdded(address omnibusWallet, string investorId, IDSOmnibusWalletController omnibusWalletController);\n    event DSRegistryServiceOmnibusWalletRemoved(address omnibusWallet, string investorId);\n\n    uint8 public constant NONE = 0;\n    uint8 public constant KYC_APPROVED = 1;\n    uint8 public constant ACCREDITED = 2;\n    uint8 public constant QUALIFIED = 4;\n    uint8 public constant PROFESSIONAL = 8;\n\n    uint8 public constant PENDING = 0;\n    uint8 public constant APPROVED = 1;\n    uint8 public constant REJECTED = 2;\n\n    uint8 public constant EXCHANGE = 4;\n\n    modifier investorExists(string memory _id) {\n        require(isInvestor(_id), \"Unknown investor\");\n        _;\n    }\n\n    modifier newInvestor(string memory _id) {\n        require(!CommonUtils.isEmptyString(_id), \"Investor id must not be empty\");\n        require(!isInvestor(_id), \"Investor already exists\");\n        _;\n    }\n\n    modifier walletExists(address _address) {\n        require(isWallet(_address), \"Unknown wallet\");\n        _;\n    }\n\n    modifier newWallet(address _address) {\n        require(!isWallet(_address), \"Wallet already exists\");\n        _;\n    }\n\n    modifier newOmnibusWallet(address _omnibusWallet) {\n        require(!isOmnibusWallet(_omnibusWallet), \"Omnibus wallet already exists\");\n        _;\n    }\n\n    modifier omnibusWalletExists(address _omnibusWallet) {\n        require(isOmnibusWallet(_omnibusWallet), \"Unknown omnibus wallet\");\n        _;\n    }\n\n    modifier walletBelongsToInvestor(address _address, string memory _id) {\n        require(CommonUtils.isEqualString(getInvestor(_address), _id), \"Wallet does not belong to investor\");\n        _;\n    }\n\n    function registerInvestor(\n        string memory _id,\n        string memory _collision_hash /*onlyExchangeOrAbove newInvestor(_id)*/\n    ) public virtual returns (bool);\n\n    function updateInvestor(\n        string memory _id,\n        string memory _collisionHash,\n        string memory _country,\n        address[] memory _wallets,\n        uint8[] memory _attributeIds,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    function removeInvestor(\n        string memory _id /*onlyExchangeOrAbove investorExists(_id)*/\n    ) public virtual returns (bool);\n\n    function setCountry(\n        string memory _id,\n        string memory _country /*onlyExchangeOrAbove investorExists(_id)*/\n    ) public virtual returns (bool);\n\n    function getCountry(string memory _id) public view virtual returns (string memory);\n\n    function getCollisionHash(string memory _id) public view virtual returns (string memory);\n\n    function setAttribute(\n        string memory _id,\n        uint8 _attributeId,\n        uint256 _value,\n        uint256 _expiry,\n        string memory _proofHash /*onlyExchangeOrAbove investorExists(_id)*/\n    ) public virtual returns (bool);\n\n    function getAttributeValue(string memory _id, uint8 _attributeId) public view virtual returns (uint256);\n\n    function getAttributeExpiry(string memory _id, uint8 _attributeId) public view virtual returns (uint256);\n\n    function getAttributeProofHash(string memory _id, uint8 _attributeId) public view virtual returns (string memory);\n\n    function addWallet(\n        address _address,\n        string memory _id /*onlyExchangeOrAbove newWallet(_address)*/\n    ) public virtual returns (bool);\n\n    function addWalletByInvestor(address _address) public virtual returns (bool);\n\n    function removeWallet(\n        address _address,\n        string memory _id /*onlyExchangeOrAbove walletExists walletBelongsToInvestor(_address, _id)*/\n    ) public virtual returns (bool);\n\n    function addOmnibusWallet(\n        string memory _id,\n        address _omnibusWallet,\n        IDSOmnibusWalletController _omnibusWalletController /*onlyIssuerOrAbove newOmnibusWallet*/\n    ) public virtual;\n\n    function removeOmnibusWallet(\n        string memory _id,\n        address _omnibusWallet /*onlyIssuerOrAbove omnibusWalletControllerExists*/\n    ) public virtual;\n\n    function getOmnibusWalletController(address _omnibusWallet) public view virtual returns (IDSOmnibusWalletController);\n\n    function isOmnibusWallet(address _omnibusWallet) public view virtual returns (bool);\n\n    function getInvestor(address _address) public view virtual returns (string memory);\n\n    function getInvestorDetails(address _address) public view virtual returns (string memory, string memory);\n\n    function getInvestorDetailsFull(string memory _id)\n        public\n        view\n        virtual\n        returns (string memory, uint256[] memory, uint256[] memory, string memory, string memory, string memory, string memory);\n\n    function isInvestor(string memory _id) public view virtual returns (bool);\n\n    function isWallet(address _address) public view virtual returns (bool);\n\n    function isAccreditedInvestor(string calldata _id) external view virtual returns (bool);\n\n    function isQualifiedInvestor(string calldata _id) external view virtual returns (bool);\n\n    function isAccreditedInvestor(address _wallet) external view virtual returns (bool);\n\n    function isQualifiedInvestor(address _wallet) external view virtual returns (bool);\n\n    function getInvestors(address _from, address _to) external view virtual returns (string memory, string memory);\n}\n"},"contracts/service/IDSServiceConsumer.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"../utils/VersionedContract.sol\";\nimport \"../utils/Initializable.sol\";\nimport \"../omnibus/IDSOmnibusWalletController.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSServiceConsumer is Initializable, VersionedContract {\n\n    function initialize() public virtual {\n        VERSIONS.push(6);\n    }\n\n    uint256 public constant TRUST_SERVICE = 1;\n    uint256 public constant DS_TOKEN = 2;\n    uint256 public constant REGISTRY_SERVICE = 4;\n    uint256 public constant COMPLIANCE_SERVICE = 8;\n    uint256 public constant UNUSED_1 = 16;\n    uint256 public constant WALLET_MANAGER = 32;\n    uint256 public constant LOCK_MANAGER = 64;\n    uint256 public constant PARTITIONS_MANAGER = 128;\n    uint256 public constant COMPLIANCE_CONFIGURATION_SERVICE = 256;\n    uint256 public constant TOKEN_ISSUER = 512;\n    uint256 public constant WALLET_REGISTRAR = 1024;\n    uint256 public constant OMNIBUS_TBE_CONTROLLER = 2048;\n    uint256 public constant TRANSACTION_RELAYER = 4096;\n    uint256 public constant TOKEN_REALLOCATOR = 8192;\n    uint256 public constant SECURITIZE_SWAP = 16384;\n\n    function getDSService(uint256 _serviceId) public view virtual returns (address);\n\n    function setDSService(\n        uint256 _serviceId,\n        address _address /*onlyMaster*/\n    ) public virtual returns (bool);\n\n    event DSServiceSet(uint256 serviceId, address serviceAddress);\n}\n"},"contracts/service/ServiceConsumer.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"./IDSServiceConsumer.sol\";\nimport \"../data-stores/ServiceConsumerDataStore.sol\";\nimport \"../token/IDSToken.sol\";\nimport \"../token/IDSTokenPartitioned.sol\";\nimport \"../compliance/IDSWalletManager.sol\";\nimport \"../compliance/IDSLockManager.sol\";\nimport \"../compliance/IDSLockManagerPartitioned.sol\";\nimport \"../compliance/IDSComplianceService.sol\";\nimport \"../compliance/IDSComplianceServicePartitioned.sol\";\nimport \"../compliance/IDSPartitionsManager.sol\";\nimport \"../compliance/IDSComplianceConfigurationService.sol\";\nimport \"../registry/IDSRegistryService.sol\";\nimport \"../omnibus/IDSOmnibusTBEController.sol\";\nimport \"../trust/IDSTrustService.sol\";\nimport \"../utils/Ownable.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract ServiceConsumer is IDSServiceConsumer, Ownable, ServiceConsumerDataStore {\n\n    // Bring role constants to save gas both in deployment (less bytecode) and usage\n    uint8 public constant ROLE_NONE = 0;\n    uint8 public constant ROLE_MASTER = 1;\n    uint8 public constant ROLE_ISSUER = 2;\n    uint8 public constant ROLE_EXCHANGE = 4;\n    uint8 public constant ROLE_TRANSFER_AGENT = 8;\n\n    function initialize() public virtual override(IDSServiceConsumer, Ownable) {\n        IDSServiceConsumer.initialize();\n        Ownable.initialize();\n\n        VERSIONS.push(6);\n    }\n\n    modifier onlyMaster {\n        IDSTrustService trustManager = getTrustService();\n        require(this.contractOwner() == msg.sender || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    /**\n   * @dev Allow invoking functions only by the users who have the MASTER role or the ISSUER role or the TRANSFER AGENT role.\n   */\n    modifier onlyIssuerOrTransferAgentOrAbove() {\n        IDSTrustService trustManager = getTrustService();\n        require(trustManager.getRole(msg.sender) == ROLE_TRANSFER_AGENT || trustManager.getRole(msg.sender) == ROLE_ISSUER || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    modifier onlyIssuerOrAbove {\n        IDSTrustService trustManager = getTrustService();\n        require(trustManager.getRole(msg.sender) == ROLE_ISSUER || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    modifier onlyTransferAgentOrAbove {\n        IDSTrustService trustManager = getTrustService();\n        require(trustManager.getRole(msg.sender) == ROLE_TRANSFER_AGENT || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    modifier onlyExchangeOrAbove {\n        IDSTrustService trustManager = getTrustService();\n        require(\n            trustManager.getRole(msg.sender) == ROLE_EXCHANGE\n            || trustManager.getRole(msg.sender) == ROLE_ISSUER\n            || trustManager.getRole(msg.sender) == ROLE_TRANSFER_AGENT\n            || trustManager.getRole(msg.sender) == ROLE_MASTER,\n            \"Insufficient trust level\"\n        );\n        _;\n    }\n\n    modifier onlyToken {\n        require(msg.sender == getDSService(DS_TOKEN), \"This function can only called by the associated token\");\n        _;\n    }\n\n    modifier onlyRegistry {\n        require(msg.sender == getDSService(REGISTRY_SERVICE), \"This function can only called by the registry service\");\n        _;\n    }\n\n    modifier onlyIssuerOrAboveOrToken {\n        if (msg.sender != getDSService(DS_TOKEN)) {\n            IDSTrustService trustManager = IDSTrustService(getDSService(TRUST_SERVICE));\n            require(trustManager.getRole(msg.sender) == ROLE_ISSUER || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        }\n        _;\n    }\n\n    modifier onlyTransferAgentOrAboveOrToken {\n        if (msg.sender != getDSService(DS_TOKEN)) {\n            IDSTrustService trustManager = IDSTrustService(getDSService(TRUST_SERVICE));\n            require(trustManager.getRole(msg.sender) == ROLE_TRANSFER_AGENT || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        }\n        _;\n    }\n\n    modifier onlyOmnibusWalletController(address omnibusWallet, IDSOmnibusWalletController omnibusWalletController) {\n        require(getRegistryService().getOmnibusWalletController(omnibusWallet) == omnibusWalletController, \"Wrong controller address\");\n        _;\n    }\n\n    modifier onlyTBEOmnibus {\n        require(msg.sender == address(getOmnibusTBEController()), \"Not authorized\");\n        _;\n    }\n\n    modifier onlyMasterOrTBEOmnibus {\n        IDSTrustService trustManager = getTrustService();\n        require(msg.sender == address(getOmnibusTBEController()) ||\n        this.contractOwner() == msg.sender || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Not authorized\");\n        _;\n    }\n\n    modifier onlyOwnerOrIssuerOrAbove {\n        if(!isOwner()) {\n            IDSTrustService trustManager = getTrustService();\n            require(trustManager.getRole(msg.sender) == ROLE_ISSUER || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        }\n        _;\n    }\n\n    function getDSService(uint256 _serviceId) public view override returns (address) {\n        return services[_serviceId];\n    }\n\n    function setDSService(uint256 _serviceId, address _address) public override onlyMaster returns (bool) {\n        services[_serviceId] = _address;\n        emit DSServiceSet(_serviceId, _address);\n        return true;\n    }\n\n    function getToken() internal view returns (IDSToken) {\n        return IDSToken(getDSService(DS_TOKEN));\n    }\n\n    function getTrustService() internal view returns (IDSTrustService) {\n        return IDSTrustService(getDSService(TRUST_SERVICE));\n    }\n\n    function getWalletManager() internal view returns (IDSWalletManager) {\n        return IDSWalletManager(getDSService(WALLET_MANAGER));\n    }\n\n    function getLockManager() internal view returns (IDSLockManager) {\n        return IDSLockManager(getDSService(LOCK_MANAGER));\n    }\n\n    function getLockManagerPartitioned() internal view returns (IDSLockManagerPartitioned) {\n        return IDSLockManagerPartitioned(getDSService(LOCK_MANAGER));\n    }\n\n    function getComplianceService() internal view returns (IDSComplianceService) {\n        return IDSComplianceService(getDSService(COMPLIANCE_SERVICE));\n    }\n\n    function getRegistryService() internal view returns (IDSRegistryService) {\n        return IDSRegistryService(getDSService(REGISTRY_SERVICE));\n    }\n\n    function getPartitionsManager() internal view returns (IDSPartitionsManager) {\n        return IDSPartitionsManager(getDSService(PARTITIONS_MANAGER));\n    }\n\n    function getTokenPartitioned() internal view returns (IDSTokenPartitioned) {\n        return IDSTokenPartitioned(getDSService(DS_TOKEN));\n    }\n\n    function getComplianceConfigurationService() internal view returns (IDSComplianceConfigurationService) {\n        return IDSComplianceConfigurationService(getDSService(COMPLIANCE_CONFIGURATION_SERVICE));\n    }\n\n    function getOmnibusTBEController() internal view returns (IDSOmnibusTBEController) {\n        return IDSOmnibusTBEController(getDSService(OMNIBUS_TBE_CONTROLLER));\n    }\n}\n"},"contracts/token/IDSToken.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"../utils/CommonUtils.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"../utils/VersionedContract.sol\";\nimport \"../utils/Initializable.sol\";\nimport \"../omnibus/IDSOmnibusWalletController.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSToken is IERC20, Initializable, VersionedContract {\n    event Issue(address indexed to, uint256 value, uint256 valueLocked);\n    event Burn(address indexed burner, uint256 value, string reason);\n    event Seize(address indexed from, address indexed to, uint256 value, string reason);\n    event OmnibusDeposit(address indexed omnibusWallet, address to, uint256 value, uint8 assetTrackingMode);\n    event OmnibusWithdraw(address indexed omnibusWallet, address from, uint256 value, uint8 assetTrackingMode);\n    event OmnibusSeize(address indexed omnibusWallet, address from, uint256 value, string reason, uint8 assetTrackingMode);\n    event OmnibusBurn(address indexed omnibusWallet, address who, uint256 value, string reason, uint8 assetTrackingMode);\n    event OmnibusTransfer(address indexed omnibusWallet, address from, address to, uint256 value, uint8 assetTrackingMode);\n    event OmnibusTBEOperation(address indexed omnibusWallet, int256 totalDelta, int256 accreditedDelta,\n        int256 usAccreditedDelta, int256 usTotalDelta, int256 jpTotalDelta);\n    event OmnibusTBETransfer(address omnibusWallet, string externalId);\n\n    event WalletAdded(address wallet);\n    event WalletRemoved(address wallet);\n\n    function initialize() public virtual {\n        VERSIONS.push(3);\n    }\n\n    /******************************\n       CONFIGURATION\n   *******************************/\n\n    /**\n     * @dev Sets the total issuance cap\n     * Note: The cap is compared to the total number of issued token, not the total number of tokens available,\n     * So if a token is burned, it is not removed from the \"total number of issued\".\n     * This call cannot be called again after it was called once.\n     * @param _cap address The address which is going to receive the newly issued tokens\n     */\n    function setCap(\n        uint256 _cap /*onlyMaster*/\n    ) public virtual;\n\n    /******************************\n       TOKEN ISSUANCE (MINTING)\n   *******************************/\n\n    /**\n     * @dev Issues unlocked tokens\n     * @param _to address The address which is going to receive the newly issued tokens\n     * @param _value uint256 the value of tokens to issue\n     * @return true if successful\n     */\n    function issueTokens(\n        address _to,\n        uint256 _value /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Issuing tokens from the fund\n     * @param _to address The address which is going to receive the newly issued tokens\n     * @param _value uint256 the value of tokens to issue\n     * @param _valueLocked uint256 value of tokens, from those issued, to lock immediately.\n     * @param _reason reason for token locking\n     * @param _releaseTime timestamp to release the lock (or 0 for locks which can only released by an unlockTokens call)\n     * @return true if successful\n     */\n    function issueTokensCustom(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime,\n        uint256 _valueLocked,\n        string memory _reason,\n        uint64 _releaseTime /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    function issueTokensWithMultipleLocks(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime,\n        uint256[] memory _valuesLocked,\n        string memory _reason,\n        uint64[] memory _releaseTimes /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    function issueTokensWithNoCompliance(address _to, uint256 _value) public virtual /*onlyIssuerOrAbove*/;\n\n    //*********************\n    // TOKEN BURNING\n    //*********************\n\n    function burn(\n        address _who,\n        uint256 _value,\n        string memory _reason /*onlyIssuerOrAbove*/\n    ) public virtual;\n\n    function omnibusBurn(\n        address _omnibusWallet,\n        address _who,\n        uint256 _value,\n        string memory _reason /*onlyIssuerOrAbove*/\n    ) public virtual;\n\n    //*********************\n    // TOKEN SIEZING\n    //*********************\n\n    function seize(\n        address _from,\n        address _to,\n        uint256 _value,\n        string memory _reason /*onlyIssuerOrAbove*/\n    ) public virtual;\n\n    function omnibusSeize(\n        address _omnibusWallet,\n        address _from,\n        address _to,\n        uint256 _value,\n        string memory _reason\n        /*onlyIssuerOrAbove*/\n    ) public virtual;\n\n    //*********************\n    // WALLET ENUMERATION\n    //*********************\n\n    function getWalletAt(uint256 _index) public view virtual returns (address);\n\n    function walletCount() public view virtual returns (uint256);\n\n    //**************************************\n    // MISCELLANEOUS FUNCTIONS\n    //**************************************\n    function isPaused() public view virtual returns (bool);\n\n    function balanceOfInvestor(string memory _id) public view virtual returns (uint256);\n\n    function updateOmnibusInvestorBalance(\n        address _omnibusWallet,\n        address _wallet,\n        uint256 _value,\n        CommonUtils.IncDec _increase /*onlyOmnibusWalletController*/\n    ) public virtual returns (bool);\n\n    function emitOmnibusTransferEvent(\n        address _omnibusWallet,\n        address _from,\n        address _to,\n        uint256 _value /*onlyOmnibusWalletController*/\n    ) public virtual;\n\n    function emitOmnibusTBEEvent(address omnibusWallet, int256 totalDelta, int256 accreditedDelta,\n        int256 usAccreditedDelta, int256 usTotalDelta, int256 jpTotalDelta /*onlyTBEOmnibus*/\n    ) public virtual;\n\n    function emitOmnibusTBETransferEvent(address omnibusWallet, string memory externalId) public virtual;\n\n    function updateInvestorBalance(address _wallet, uint256 _value, CommonUtils.IncDec _increase) internal virtual returns (bool);\n\n    function preTransferCheck(address _from, address _to, uint256 _value) public view virtual returns (uint256 code, string memory reason);\n}\n"},"contracts/token/IDSTokenPartitioned.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"./IDSToken.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSTokenPartitioned {\n\n    function balanceOfByPartition(address _who, bytes32 _partition) public view virtual returns (uint256);\n\n    function balanceOfInvestorByPartition(string memory _id, bytes32 _partition) public view virtual returns (uint256);\n\n    function partitionCountOf(address _who) public view virtual returns (uint256);\n\n    function partitionOf(address _who, uint256 _index) public view virtual returns (bytes32);\n\n    function transferByPartitions(address _to, uint256 _value, bytes32[] memory _partitions, uint256[] memory _values) public virtual returns (bool);\n\n    function transferFromByPartitions(address _from, address _to, uint256 _value, bytes32[] memory _partitions, uint256[] memory _values) public virtual returns (bool);\n\n    function burnByPartition(\n        address _who,\n        uint256 _value,\n        string memory _reason,\n        bytes32 _partition /*onlyIssuerOrAbove*/\n    ) public virtual;\n\n    function seizeByPartition(\n        address _from,\n        address _to,\n        uint256 _value,\n        string memory _reason,\n        bytes32 _partition /*onlyIssuerOrAbove*/\n    ) public virtual;\n\n    event TransferByPartition(address indexed from, address indexed to, uint256 value, bytes32 indexed partition);\n    event IssueByPartition(address indexed to, uint256 value, bytes32 indexed partition);\n    event BurnByPartition(address indexed burner, uint256 value, string reason, bytes32 indexed partition);\n    event SeizeByPartition(address indexed from, address indexed to, uint256 value, string reason, bytes32 indexed partition);\n}\n"},"contracts/trust/IDSTrustService.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"../utils/VersionedContract.sol\";\nimport \"../utils/Initializable.sol\";\n\n\n/**\n * @title IDSTrustService\n * @dev An interface for a trust service which allows role-based access control for other contracts.\n */\n//SPDX-License-Identifier: UNLICENSED\nabstract contract IDSTrustService is Initializable, VersionedContract {\n\n    function initialize() public virtual {\n        VERSIONS.push(4);\n    }\n\n    /**\n     * @dev Should be emitted when a role is set for a user.\n     */\n    event DSTrustServiceRoleAdded(address targetAddress, uint8 role, address sender);\n    /**\n     * @dev Should be emitted when a role is removed for a user.\n     */\n    event DSTrustServiceRoleRemoved(address targetAddress, uint8 role, address sender);\n\n    // Role constants\n    uint8 public constant NONE = 0;\n    uint8 public constant MASTER = 1;\n    uint8 public constant ISSUER = 2;\n    uint8 public constant EXCHANGE = 4;\n    uint8 public constant TRANSFER_AGENT = 8;\n\n    /**\n     * @dev Transfers the ownership (MASTER role) of the contract.\n     * @param _address The address which the ownership needs to be transferred to.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function setServiceOwner(\n        address _address /*onlyMaster*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Sets a role for an array of wallets.\n     * @dev Should not be used for setting MASTER (use setServiceOwner) or role removal (use removeRole).\n     * @param _addresses The array of wallet whose role needs to be set.\n     * @param _roles The array of role to be set. The lenght and order must match with _addresses\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function setRoles(address[] memory _addresses, uint8[] memory _roles) public virtual returns (bool);\n\n    /**\n     * @dev Sets a role for a wallet.\n     * @dev Should not be used for setting MASTER (use setServiceOwner) or role removal (use removeRole).\n     * @param _address The wallet whose role needs to be set.\n     * @param _role The role to be set.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function setRole(\n        address _address,\n        uint8 _role /*onlyMasterOrIssuer*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Removes the role for a wallet.\n     * @dev Should not be used to remove MASTER (use setServiceOwner).\n     * @param _address The wallet whose role needs to be removed.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function removeRole(\n        address _address /*onlyMasterOrIssuer*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Gets the role for a wallet.\n     * @param _address The wallet whose role needs to be fetched.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function getRole(address _address) public view virtual returns (uint8);\n\n    function addEntity(\n        string memory _name,\n        address _owner /*onlyMasterOrIssuer onlyNewEntity onlyNewEntityOwner*/\n    ) public virtual;\n\n    function changeEntityOwner(\n        string memory _name,\n        address _oldOwner,\n        address _newOwner /*onlyMasterOrIssuer onlyExistingEntityOwner*/\n    ) public virtual;\n\n    function addOperator(\n        string memory _name,\n        address _operator /*onlyEntityOwnerOrAbove onlyNewOperator*/\n    ) public virtual;\n\n    function removeOperator(\n        string memory _name,\n        address _operator /*onlyEntityOwnerOrAbove onlyExistingOperator*/\n    ) public virtual;\n\n    function addResource(\n        string memory _name,\n        address _resource /*onlyMasterOrIssuer onlyExistingEntity onlyNewResource*/\n    ) public virtual;\n\n    function removeResource(\n        string memory _name,\n        address _resource /*onlyMasterOrIssuer onlyExistingResource*/\n    ) public virtual;\n\n    function getEntityByOwner(address _owner) public view virtual returns (string memory);\n\n    function getEntityByOperator(address _operator) public view virtual returns (string memory);\n\n    function getEntityByResource(address _resource) public view virtual returns (string memory);\n\n    function isResourceOwner(address _resource, address _owner) public view virtual returns (bool);\n\n    function isResourceOperator(address _resource, address _operator) public view virtual returns (bool);\n}\n"},"contracts/utils/CommonUtils.sol":{"content":"pragma solidity ^0.8.13;\n\n//SPDX-License-Identifier: UNLICENSED\nlibrary CommonUtils {\n  enum IncDec { Increase, Decrease }\n\n  function encodeString(string memory _str) internal pure returns (bytes32) {\n    return keccak256(abi.encodePacked(_str));\n  }\n\n  function isEqualString(string memory _str1, string memory _str2) internal pure returns (bool) {\n    return encodeString(_str1) == encodeString(_str2);\n  }\n\n  function isEmptyString(string memory _str) internal pure returns (bool) {\n    return isEqualString(_str, \"\");\n  }\n}\n"},"contracts/utils/Initializable.sol":{"content":"pragma solidity ^0.8.13;\n\n//SPDX-License-Identifier: UNLICENSED\ncontract Initializable {\n    bool public initialized = false;\n\n    modifier initializer() {\n        require(!initialized, \"Contract instance has already been initialized\");\n\n        _;\n\n        initialized = true;\n    }\n}\n"},"contracts/utils/Ownable.sol":{"content":"pragma solidity ^0.8.13;\n\nimport \"./Initializable.sol\";\n\n//SPDX-License-Identifier: UNLICENSED\nabstract contract Ownable is Initializable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    function initialize() public virtual initializer {\n        _owner = msg.sender;\n        emit OwnershipTransferred(address(0), _owner);\n    }\n\n    //Legacy function\n    function owner() public view returns (address) {\n        return contractOwner();\n    }\n\n    function contractOwner() public view returns (address) {\n        return _owner;\n    }\n\n    modifier onlyOwner() {\n        require(isOwner(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    function isOwner() public view returns (bool) {\n        return msg.sender == _owner;\n    }\n\n    function renounceOwnership() public onlyOwner {\n        emit OwnershipTransferred(_owner, address(0));\n        _owner = address(0);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public onlyOwner {\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     */\n    function _transferOwnership(address newOwner) internal {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        emit OwnershipTransferred(_owner, newOwner);\n        _owner = newOwner;\n    }\n}\n"},"contracts/utils/ProxyTarget.sol":{"content":"pragma solidity ^0.8.13;\n\n//SPDX-License-Identifier: UNLICENSED\ncontract ProxyTarget {\n    address internal ___t1;\n    address internal ___t2;\n\n    modifier forceInitializeFromProxy() {\n        require(___t1 != address(0x0), \"Must be initialized from proxy\");\n\n        _;\n    }\n}\n"},"contracts/utils/VersionedContract.sol":{"content":"pragma solidity ^0.8.13;\n\n//SPDX-License-Identifier: UNLICENSED\ncontract VersionedContract {\n    uint256[] internal VERSIONS = [1];\n\n    function getVersion() public view returns (uint256[] memory) {\n        return VERSIONS;\n    }\n}\n"}},"matchId":"12622157","creationMatch":"match","runtimeMatch":"match","verifiedAt":"2026-01-02T06:54:30Z","match":"match","chainId":"1","address":"0x0E4d0fC75407De18BDE9930CBBC3238ebaC29FDa"}