@t-rex-network/t-rex 4.2.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +674 -0
- package/README.md +137 -0
- package/contracts/ERC-3643/ERC3643EventsLib.sol +150 -0
- package/contracts/ERC-3643/IERC3643.sol +408 -0
- package/contracts/ERC-3643/IERC3643ClaimTopicsRegistry.sol +66 -0
- package/contracts/ERC-3643/IERC3643Compliance.sol +127 -0
- package/contracts/ERC-3643/IERC3643IdentityRegistry.sol +180 -0
- package/contracts/ERC-3643/IERC3643IdentityRegistryStorage.sol +120 -0
- package/contracts/ERC-3643/IERC3643TrustedIssuersRegistry.sol +120 -0
- package/contracts/compliance/modular/IModularCompliance.sol +143 -0
- package/contracts/compliance/modular/ModularCompliance.sol +381 -0
- package/contracts/compliance/modular/modules/AbstractModuleUpgradeable.sol +193 -0
- package/contracts/compliance/modular/modules/IModule.sol +158 -0
- package/contracts/compliance/modular/modules/ModuleProxy.sol +72 -0
- package/contracts/factory/ITREXFactory.sol +180 -0
- package/contracts/factory/ITREXGateway.sol +234 -0
- package/contracts/factory/TREXFactory.sol +358 -0
- package/contracts/factory/TREXGateway.sol +274 -0
- package/contracts/libraries/ErrorsLib.sol +168 -0
- package/contracts/libraries/EventsLib.sol +147 -0
- package/contracts/proxy/AbstractProxy.sol +146 -0
- package/contracts/proxy/ClaimTopicsRegistryProxy.sol +83 -0
- package/contracts/proxy/IdentityRegistryProxy.sol +95 -0
- package/contracts/proxy/IdentityRegistryStorageProxy.sol +83 -0
- package/contracts/proxy/ModularComplianceProxy.sol +88 -0
- package/contracts/proxy/TokenProxy.sol +97 -0
- package/contracts/proxy/TrustedIssuersRegistryProxy.sol +88 -0
- package/contracts/proxy/authority/IAFactory.sol +122 -0
- package/contracts/proxy/authority/IIAFactory.sol +87 -0
- package/contracts/proxy/authority/ITREXImplementationAuthority.sol +239 -0
- package/contracts/proxy/authority/TREXImplementationAuthority.sol +350 -0
- package/contracts/proxy/interface/IProxy.sol +72 -0
- package/contracts/registry/implementation/ClaimTopicsRegistry.sol +152 -0
- package/contracts/registry/implementation/IdentityRegistry.sol +352 -0
- package/contracts/registry/implementation/IdentityRegistryStorage.sol +227 -0
- package/contracts/registry/implementation/TrustedIssuersRegistry.sol +272 -0
- package/contracts/registry/interface/IClaimTopicsRegistry.sol +70 -0
- package/contracts/registry/interface/IIdentityRegistry.sol +102 -0
- package/contracts/registry/interface/IIdentityRegistryStorage.sol +70 -0
- package/contracts/registry/interface/ITrustedIssuersRegistry.sol +70 -0
- package/contracts/roles/AbstractAgentRole.sol +122 -0
- package/contracts/roles/AgentRole.sol +82 -0
- package/contracts/roles/AgentRoleUpgradeable.sol +82 -0
- package/contracts/roles/IERC173.sol +21 -0
- package/contracts/roles/Roles.sol +102 -0
- package/contracts/token/IToken.sol +97 -0
- package/contracts/token/Token.sol +664 -0
- package/contracts/token/TokenStructs.sol +74 -0
- package/contracts/utils/IUtilityChecker.sol +135 -0
- package/contracts/utils/InterfaceIdCalculator.sol +223 -0
- package/contracts/utils/UtilityChecker.sol +210 -0
- package/contracts/utils/UtilityCheckerProxy.sol +72 -0
- package/contracts/vendor/openzeppelin/Create3.sol +143 -0
- package/out/AbstractAgentRole.sol/AbstractAgentRole.json +1 -0
- package/out/AbstractModuleUpgradeable.sol/AbstractModuleUpgradeable.json +1 -0
- package/out/AbstractProxy.sol/AbstractProxy.json +1 -0
- package/out/Address.sol/Address.json +1 -0
- package/out/AgentRole.sol/AgentRole.json +1 -0
- package/out/AgentRoleUpgradeable.sol/AgentRoleUpgradeable.json +1 -0
- package/out/Arrays.sol/Arrays.json +1 -0
- package/out/Base.sol/CommonBase.json +1 -0
- package/out/Base.sol/ScriptBase.json +1 -0
- package/out/Base.sol/TestBase.json +1 -0
- package/out/Bytes.sol/Bytes.json +1 -0
- package/out/ClaimIssuer.sol/ClaimIssuer.json +1 -0
- package/out/ClaimIssuerTrick.sol/ClaimIssuerTrick.json +1 -0
- package/out/ClaimTopicsRegistry.sol/ClaimTopicsRegistry.json +1 -0
- package/out/ClaimTopicsRegistryProxy.sol/ClaimTopicsRegistryProxy.json +1 -0
- package/out/Comparators.sol/Comparators.json +1 -0
- package/out/Context.sol/Context.json +1 -0
- package/out/ContextUpgradeable.sol/ContextUpgradeable.json +1 -0
- package/out/Countries.sol/Countries.json +1 -0
- package/out/Create2.sol/Create2.json +1 -0
- package/out/Create3.sol/Create3.json +1 -0
- package/out/ECDSA.sol/ECDSA.json +1 -0
- package/out/EIP712.sol/EIP712.json +1 -0
- package/out/EIP712Upgradeable.sol/EIP712Upgradeable.json +1 -0
- package/out/ERC1967Proxy.sol/ERC1967Proxy.json +1 -0
- package/out/ERC1967Utils.sol/ERC1967Utils.json +1 -0
- package/out/ERC20.sol/ERC20.json +1 -0
- package/out/ERC20Pausable.sol/ERC20Pausable.json +1 -0
- package/out/ERC20PermitUpgradeable.sol/ERC20PermitUpgradeable.json +1 -0
- package/out/ERC20Upgradeable.sol/ERC20Upgradeable.json +1 -0
- package/out/ERC2771Context.sol/ERC2771Context.json +1 -0
- package/out/ERC2771ContextUpgradeable.sol/ERC2771ContextUpgradeable.json +1 -0
- package/out/ERC2771Forwarder.sol/ERC2771Forwarder.json +1 -0
- package/out/ERC3643EventsLib.sol/ERC3643EventsLib.json +1 -0
- package/out/EnumerableSet.sol/EnumerableSet.json +1 -0
- package/out/Errors.sol/Errors.json +1 -0
- package/out/ErrorsLib.sol/ErrorsLib.json +1 -0
- package/out/EventsLib.sol/EventsLib.json +1 -0
- package/out/IAFactory.sol/IAFactory.json +1 -0
- package/out/IBeacon.sol/IBeacon.json +1 -0
- package/out/IClaimIssuer.sol/IClaimIssuer.json +1 -0
- package/out/IClaimTopicsRegistry.sol/IClaimTopicsRegistry.json +1 -0
- package/out/IERC1363.sol/IERC1363.json +1 -0
- package/out/IERC165.sol/IERC165.json +1 -0
- package/out/IERC173.sol/IERC173.json +1 -0
- package/out/IERC1967.sol/IERC1967.json +1 -0
- package/out/IERC20.sol/IERC20.json +1 -0
- package/out/IERC20Metadata.sol/IERC20Metadata.json +1 -0
- package/out/IERC20Permit.sol/IERC20Permit.json +1 -0
- package/out/IERC3643.sol/IERC3643.json +1 -0
- package/out/IERC3643ClaimTopicsRegistry.sol/IERC3643ClaimTopicsRegistry.json +1 -0
- package/out/IERC3643Compliance.sol/IERC3643Compliance.json +1 -0
- package/out/IERC3643IdentityRegistry.sol/IERC3643IdentityRegistry.json +1 -0
- package/out/IERC3643IdentityRegistryStorage.sol/IERC3643IdentityRegistryStorage.json +1 -0
- package/out/IERC3643TrustedIssuersRegistry.sol/IERC3643TrustedIssuersRegistry.json +1 -0
- package/out/IERC5267.sol/IERC5267.json +1 -0
- package/out/IERC734.sol/IERC734.json +1 -0
- package/out/IERC735.sol/IERC735.json +1 -0
- package/out/IIAFactory.sol/IIAFactory.json +1 -0
- package/out/IIdFactory.sol/IIdFactory.json +1 -0
- package/out/IIdentity.sol/IIdentity.json +1 -0
- package/out/IIdentityRegistry.sol/IIdentityRegistry.json +1 -0
- package/out/IIdentityRegistryStorage.sol/IIdentityRegistryStorage.json +1 -0
- package/out/IImplementationAuthority.sol/IImplementationAuthority.json +1 -0
- package/out/IModularCompliance.sol/IModularCompliance.json +1 -0
- package/out/IModule.sol/IModule.json +1 -0
- package/out/IMulticall3.sol/IMulticall3.json +1 -0
- package/out/IProxy.sol/IProxy.json +1 -0
- package/out/ITREXFactory.sol/ITREXFactory.json +1 -0
- package/out/ITREXGateway.sol/ITREXGateway.json +1 -0
- package/out/ITREXImplementationAuthority.sol/ITREXImplementationAuthority.json +1 -0
- package/out/IToken.sol/IToken.json +1 -0
- package/out/ITrustedIssuersRegistry.sol/ITrustedIssuersRegistry.json +1 -0
- package/out/IUtilityChecker.sol/IUtilityChecker.json +1 -0
- package/out/IdFactory.sol/IdFactory.json +1 -0
- package/out/Identity.sol/Identity.json +1 -0
- package/out/IdentityProxy.sol/IdentityProxy.json +1 -0
- package/out/IdentityRegistry.sol/IdentityRegistry.json +1 -0
- package/out/IdentityRegistryProxy.sol/IdentityRegistryProxy.json +1 -0
- package/out/IdentityRegistryStorage.sol/IdentityRegistryStorage.json +1 -0
- package/out/IdentityRegistryStorageProxy.sol/IdentityRegistryStorageProxy.json +1 -0
- package/out/ImplementationAuthority.sol/ImplementationAuthority.json +1 -0
- package/out/Initializable.sol/Initializable.json +1 -0
- package/out/InterfaceIdCalculator.sol/InterfaceIdCalculator.json +1 -0
- package/out/KeyPurposes.sol/KeyPurposes.json +1 -0
- package/out/KeyTypes.sol/KeyTypes.json +1 -0
- package/out/LowLevelCall.sol/LowLevelCall.json +1 -0
- package/out/Math.sol/Math.json +1 -0
- package/out/MessageHashUtils.sol/MessageHashUtils.json +1 -0
- package/out/ModularCompliance.sol/ModularCompliance.json +1 -0
- package/out/ModularComplianceProxy.sol/ModularComplianceProxy.json +1 -0
- package/out/ModuleNotPnP.sol/ModuleNotPnP.json +1 -0
- package/out/ModuleProxy.sol/ModuleProxy.json +1 -0
- package/out/MulticallUpgradeable.sol/MulticallUpgradeable.json +1 -0
- package/out/Nonces.sol/Nonces.json +1 -0
- package/out/NoncesUpgradeable.sol/NoncesUpgradeable.json +1 -0
- package/out/Ownable.sol/Ownable.json +1 -0
- package/out/Ownable2Step.sol/Ownable2Step.json +1 -0
- package/out/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.json +1 -0
- package/out/OwnableUpgradeable.sol/OwnableUpgradeable.json +1 -0
- package/out/Panic.sol/Panic.json +1 -0
- package/out/Pausable.sol/Pausable.json +1 -0
- package/out/PausableUpgradeable.sol/PausableUpgradeable.json +1 -0
- package/out/Proxy.sol/Proxy.json +1 -0
- package/out/Roles.sol/Roles.json +1 -0
- package/out/SafeCast.sol/SafeCast.json +1 -0
- package/out/SafeERC20.sol/SafeERC20.json +1 -0
- package/out/ShortStrings.sol/ShortStrings.json +1 -0
- package/out/SignedMath.sol/SignedMath.json +1 -0
- package/out/SlotDerivation.sol/SlotDerivation.json +1 -0
- package/out/StdAssertions.sol/StdAssertions.json +1 -0
- package/out/StdChains.sol/StdChains.json +1 -0
- package/out/StdCheats.sol/StdCheats.json +1 -0
- package/out/StdCheats.sol/StdCheatsSafe.json +1 -0
- package/out/StdConstants.sol/StdConstants.json +1 -0
- package/out/StdError.sol/stdError.json +1 -0
- package/out/StdInvariant.sol/StdInvariant.json +1 -0
- package/out/StdJson.sol/stdJson.json +1 -0
- package/out/StdMath.sol/stdMath.json +1 -0
- package/out/StdStorage.sol/stdStorage.json +1 -0
- package/out/StdStorage.sol/stdStorageSafe.json +1 -0
- package/out/StdStyle.sol/StdStyle.json +1 -0
- package/out/StdToml.sol/stdToml.json +1 -0
- package/out/StdUtils.sol/StdUtils.json +1 -0
- package/out/Storage.sol/Storage.json +1 -0
- package/out/StorageSlot.sol/StorageSlot.json +1 -0
- package/out/Strings.sol/Strings.json +1 -0
- package/out/Structs.sol/Structs.json +1 -0
- package/out/TREXFactory.sol/TREXFactory.json +1 -0
- package/out/TREXGateway.sol/TREXGateway.json +1 -0
- package/out/TREXImplementationAuthority.sol/TREXImplementationAuthority.json +1 -0
- package/out/TestAgentRole.sol/TestAgentRole.json +1 -0
- package/out/TestAgentRoleUpgradeable.sol/TestAgentRoleUpgradeable.json +1 -0
- package/out/TestERC20.sol/TestERC20.json +1 -0
- package/out/TestModule.sol/TestModule.json +1 -0
- package/out/TestTREXFactory.sol/TestTREXFactory.json +1 -0
- package/out/Token.sol/Token.json +1 -0
- package/out/TokenProxy.sol/TokenProxy.json +1 -0
- package/out/TrustedIssuersRegistry.sol/TrustedIssuersRegistry.json +1 -0
- package/out/TrustedIssuersRegistryProxy.sol/TrustedIssuersRegistryProxy.json +1 -0
- package/out/UUPSUpgradeable.sol/UUPSUpgradeable.json +1 -0
- package/out/UtilityChecker.sol/UtilityChecker.json +1 -0
- package/out/UtilityCheckerProxy.sol/UtilityCheckerProxy.json +1 -0
- package/out/Utils.sol/Utils.json +1 -0
- package/out/Version.sol/Version.json +1 -0
- package/out/Vm.sol/Vm.json +1 -0
- package/out/Vm.sol/VmSafe.json +1 -0
- package/out/console.sol/console.json +1 -0
- package/out/draft-IERC1822.sol/IERC1822Proxiable.json +1 -0
- package/out/draft-IERC6093.sol/IERC1155Errors.json +1 -0
- package/out/draft-IERC6093.sol/IERC20Errors.json +1 -0
- package/out/draft-IERC6093.sol/IERC721Errors.json +1 -0
- package/out/libraries/Errors.sol/Errors.json +1 -0
- package/out/safeconsole.sol/safeconsole.json +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
2
|
+
//
|
|
3
|
+
// :+#####%%%%%%%%%%%%%%+
|
|
4
|
+
// .-*@@@%+.:+%@@@@@%%#***%@@%=
|
|
5
|
+
// :=*%@@@#=. :#@@% *@@@%=
|
|
6
|
+
// .-+*%@%*-.:+%@@@@@@+. -*+: .=#. :%@@@%-
|
|
7
|
+
// :=*@@@@%%@@@@@@@@@%@@@- .=#@@@%@%= =@@@@#.
|
|
8
|
+
// -=+#%@@%#*=:. :%@@@@%. -*@@#*@@@@@@@#=:- *@@@@+
|
|
9
|
+
// =@@%=:. :=: *@@@@@%#- =%*%@@@@#+-. =+ :%@@@%-
|
|
10
|
+
// -@@%. .+@@@ =+=-. @@#- +@@@%- =@@@@%:
|
|
11
|
+
// :@@@. .+@@#%: : .=*=-::.-%@@@+*@@= +@@@@#.
|
|
12
|
+
// %@@: +@%%* =%@@@@@@@@@@@#. .*@%- +@@@@*.
|
|
13
|
+
// #@@= .+@@@@%:=*@@@@@- :%@%: .*@@@@+
|
|
14
|
+
// *@@* +@@@#-@@%-:%@@* +@@#. :%@@@@-
|
|
15
|
+
// -@@% .:-=++*##%%%@@@@@@@@@@@@*. :@+.@@@%: .#@@+ =@@@@#:
|
|
16
|
+
// .@@@*-+*#%%%@@@@@@@@@@@@@@@@%%#**@@%@@@. *@=*@@# :#@%= .#@@@@#-
|
|
17
|
+
// -%@@@@@@@@@@@@@@@*+==-:-@@@= *@# .#@*-=*@@@@%= -%@@@* =@@@@@%-
|
|
18
|
+
// -+%@@@#. %@%%= -@@:+@: -@@* *@@*-:: -%@@%=. .*@@@@@#
|
|
19
|
+
// *@@@* +@* *@@##@@- #@*@@+ -@@= . :+@@@#: .-+@@@%+-
|
|
20
|
+
// +@@@%*@@:..=@@@@* .@@@* .#@#. .=+- .=%@@@*. :+#@@@@*=:
|
|
21
|
+
// =@@@@%@@@@@@@@@@@@@@@@@@@@@@%- :+#*. :*@@@%=. .=#@@@@%+:
|
|
22
|
+
// .%@@= ..... .=#@@+. .#@@@*: -*%@@@@%+.
|
|
23
|
+
// +@@#+===---:::... .=%@@*- +@@@+. -*@@@@@%+.
|
|
24
|
+
// -@@@@@@@@@@@@@@@@@@@@@@%@@@@= -@@@+ -#@@@@@#=.
|
|
25
|
+
// ..:::---===+++***###%%%@@@#- .#@@+ -*@@@@@#=.
|
|
26
|
+
// @@@@@@+. +@@*. .+@@@@@%=.
|
|
27
|
+
// -@@@@@= =@@%: -#@@@@%+.
|
|
28
|
+
// +@@@@@. =@@@= .+@@@@@*:
|
|
29
|
+
// #@@@@#:%@@#. :*@@@@#-
|
|
30
|
+
// @@@@@%@@@= :#@@@@+.
|
|
31
|
+
// :@@@@@@@#.:#@@@%-
|
|
32
|
+
// +@@@@@@-.*@@@*:
|
|
33
|
+
// #@@@@#.=@@@+.
|
|
34
|
+
// @@@@+-%@%=
|
|
35
|
+
// :@@@#%@%=
|
|
36
|
+
// +@@@@%-
|
|
37
|
+
// :#%%=
|
|
38
|
+
//
|
|
39
|
+
/**
|
|
40
|
+
* NOTICE
|
|
41
|
+
*
|
|
42
|
+
* The T-REX software is licensed under a proprietary license or the GPL v.3.
|
|
43
|
+
* If you choose to receive it under the GPL v.3 license, the following applies:
|
|
44
|
+
* T-REX is a suite of smart contracts implementing the ERC-3643 standard and
|
|
45
|
+
* developed by Tokeny to manage and transfer financial assets on EVM blockchains
|
|
46
|
+
*
|
|
47
|
+
* Copyright (C) 2025, Tokeny sàrl.
|
|
48
|
+
*
|
|
49
|
+
* This program is free software: you can redistribute it and/or modify
|
|
50
|
+
* it under the terms of the GNU General Public License as published by
|
|
51
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
52
|
+
* (at your option) any later version.
|
|
53
|
+
*
|
|
54
|
+
* This program is distributed in the hope that it will be useful,
|
|
55
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
56
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
57
|
+
* GNU General Public License for more details.
|
|
58
|
+
*
|
|
59
|
+
* You should have received a copy of the GNU General Public License
|
|
60
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
pragma solidity 0.8.30;
|
|
64
|
+
|
|
65
|
+
import { Ownable2StepUpgradeable } from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
|
|
66
|
+
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
67
|
+
|
|
68
|
+
import { ERC3643EventsLib } from "../../ERC-3643/ERC3643EventsLib.sol";
|
|
69
|
+
import { IERC3643ClaimTopicsRegistry } from "../../ERC-3643/IERC3643ClaimTopicsRegistry.sol";
|
|
70
|
+
import { ErrorsLib } from "../../libraries/ErrorsLib.sol";
|
|
71
|
+
import { IERC173 } from "../../roles/IERC173.sol";
|
|
72
|
+
import { IClaimTopicsRegistry } from "../interface/IClaimTopicsRegistry.sol";
|
|
73
|
+
|
|
74
|
+
contract ClaimTopicsRegistry is IClaimTopicsRegistry, Ownable2StepUpgradeable, IERC165 {
|
|
75
|
+
|
|
76
|
+
/// @custom:storage-location erc7201:ERC3643.storage.ClaimTopicsRegistry
|
|
77
|
+
struct Storage {
|
|
78
|
+
uint256[] claimTopics;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// keccak256(abi.encode(uint256(keccak256("ERC3643.storage.ClaimTopicsRegistry")) - 1)) & ~bytes32(uint256(0xff));
|
|
82
|
+
bytes32 private constant STORAGE_LOCATION = 0xeb77843660c963beb5d27db8816b70a285e2678d36793e5743f8650e153ee600;
|
|
83
|
+
|
|
84
|
+
constructor() {
|
|
85
|
+
_disableInitializers();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function init(address _owner, uint256[] calldata _initialTopics) external initializer {
|
|
89
|
+
require(_initialTopics.length <= 5, ErrorsLib.MaxClaimTopicsReached(5));
|
|
90
|
+
__Ownable_init(_owner);
|
|
91
|
+
for (uint256 i = 0; i < _initialTopics.length; i++) {
|
|
92
|
+
_addClaimTopic(_initialTopics[i]);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @dev See {IClaimTopicsRegistry-addClaimTopic}.
|
|
98
|
+
*/
|
|
99
|
+
function addClaimTopic(uint256 claimTopic) external override onlyOwner {
|
|
100
|
+
_addClaimTopic(claimTopic);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @dev See {IClaimTopicsRegistry-removeClaimTopic}.
|
|
105
|
+
*/
|
|
106
|
+
function removeClaimTopic(uint256 claimTopic) external override onlyOwner {
|
|
107
|
+
Storage storage s = _getStorage();
|
|
108
|
+
uint256 length = s.claimTopics.length;
|
|
109
|
+
for (uint256 i = 0; i < length; i++) {
|
|
110
|
+
if (s.claimTopics[i] == claimTopic) {
|
|
111
|
+
s.claimTopics[i] = s.claimTopics[length - 1];
|
|
112
|
+
s.claimTopics.pop();
|
|
113
|
+
emit ERC3643EventsLib.ClaimTopicRemoved(claimTopic);
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @dev See {IClaimTopicsRegistry-getClaimTopics}.
|
|
121
|
+
*/
|
|
122
|
+
function getClaimTopics() external view override returns (uint256[] memory) {
|
|
123
|
+
return _getStorage().claimTopics;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @dev See {IERC165-supportsInterface}.
|
|
128
|
+
*/
|
|
129
|
+
function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) {
|
|
130
|
+
return interfaceId == type(IERC3643ClaimTopicsRegistry).interfaceId || interfaceId == type(IERC173).interfaceId
|
|
131
|
+
|| interfaceId == type(IERC165).interfaceId;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function _addClaimTopic(uint256 claimTopic) internal {
|
|
135
|
+
Storage storage s = _getStorage();
|
|
136
|
+
uint256 length = s.claimTopics.length;
|
|
137
|
+
require(length < 15, ErrorsLib.MaxTopicsReached(15));
|
|
138
|
+
for (uint256 i = 0; i < length; i++) {
|
|
139
|
+
require(s.claimTopics[i] != claimTopic, ErrorsLib.ClaimTopicAlreadyExists());
|
|
140
|
+
}
|
|
141
|
+
s.claimTopics.push(claimTopic);
|
|
142
|
+
emit ERC3643EventsLib.ClaimTopicAdded(claimTopic);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function _getStorage() internal pure returns (Storage storage s) {
|
|
146
|
+
// solhint-disable-next-line no-inline-assembly
|
|
147
|
+
assembly {
|
|
148
|
+
s.slot := STORAGE_LOCATION
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
2
|
+
//
|
|
3
|
+
// :+#####%%%%%%%%%%%%%%+
|
|
4
|
+
// .-*@@@%+.:+%@@@@@%%#***%@@%=
|
|
5
|
+
// :=*%@@@#=. :#@@% *@@@%=
|
|
6
|
+
// .-+*%@%*-.:+%@@@@@@+. -*+: .=#. :%@@@%-
|
|
7
|
+
// :=*@@@@%%@@@@@@@@@%@@@- .=#@@@%@%= =@@@@#.
|
|
8
|
+
// -=+#%@@%#*=:. :%@@@@%. -*@@#*@@@@@@@#=:- *@@@@+
|
|
9
|
+
// =@@%=:. :=: *@@@@@%#- =%*%@@@@#+-. =+ :%@@@%-
|
|
10
|
+
// -@@%. .+@@@ =+=-. @@#- +@@@%- =@@@@%:
|
|
11
|
+
// :@@@. .+@@#%: : .=*=-::.-%@@@+*@@= +@@@@#.
|
|
12
|
+
// %@@: +@%%* =%@@@@@@@@@@@#. .*@%- +@@@@*.
|
|
13
|
+
// #@@= .+@@@@%:=*@@@@@- :%@%: .*@@@@+
|
|
14
|
+
// *@@* +@@@#-@@%-:%@@* +@@#. :%@@@@-
|
|
15
|
+
// -@@% .:-=++*##%%%@@@@@@@@@@@@*. :@+.@@@%: .#@@+ =@@@@#:
|
|
16
|
+
// .@@@*-+*#%%%@@@@@@@@@@@@@@@@%%#**@@%@@@. *@=*@@# :#@%= .#@@@@#-
|
|
17
|
+
// -%@@@@@@@@@@@@@@@*+==-:-@@@= *@# .#@*-=*@@@@%= -%@@@* =@@@@@%-
|
|
18
|
+
// -+%@@@#. %@%%= -@@:+@: -@@* *@@*-:: -%@@%=. .*@@@@@#
|
|
19
|
+
// *@@@* +@* *@@##@@- #@*@@+ -@@= . :+@@@#: .-+@@@%+-
|
|
20
|
+
// +@@@%*@@:..=@@@@* .@@@* .#@#. .=+- .=%@@@*. :+#@@@@*=:
|
|
21
|
+
// =@@@@%@@@@@@@@@@@@@@@@@@@@@@%- :+#*. :*@@@%=. .=#@@@@%+:
|
|
22
|
+
// .%@@= ..... .=#@@+. .#@@@*: -*%@@@@%+.
|
|
23
|
+
// +@@#+===---:::... .=%@@*- +@@@+. -*@@@@@%+.
|
|
24
|
+
// -@@@@@@@@@@@@@@@@@@@@@@%@@@@= -@@@+ -#@@@@@#=.
|
|
25
|
+
// ..:::---===+++***###%%%@@@#- .#@@+ -*@@@@@#=.
|
|
26
|
+
// @@@@@@+. +@@*. .+@@@@@%=.
|
|
27
|
+
// -@@@@@= =@@%: -#@@@@%+.
|
|
28
|
+
// +@@@@@. =@@@= .+@@@@@*:
|
|
29
|
+
// #@@@@#:%@@#. :*@@@@#-
|
|
30
|
+
// @@@@@%@@@= :#@@@@+.
|
|
31
|
+
// :@@@@@@@#.:#@@@%-
|
|
32
|
+
// +@@@@@@-.*@@@*:
|
|
33
|
+
// #@@@@#.=@@@+.
|
|
34
|
+
// @@@@+-%@%=
|
|
35
|
+
// :@@@#%@%=
|
|
36
|
+
// +@@@@%-
|
|
37
|
+
// :#%%=
|
|
38
|
+
//
|
|
39
|
+
/**
|
|
40
|
+
* NOTICE
|
|
41
|
+
*
|
|
42
|
+
* The T-REX software is licensed under a proprietary license or the GPL v.3.
|
|
43
|
+
* If you choose to receive it under the GPL v.3 license, the following applies:
|
|
44
|
+
* T-REX is a suite of smart contracts implementing the ERC-3643 standard and
|
|
45
|
+
* developed by Tokeny to manage and transfer financial assets on EVM blockchains
|
|
46
|
+
*
|
|
47
|
+
* Copyright (C) 2025, Tokeny sàrl.
|
|
48
|
+
*
|
|
49
|
+
* This program is free software: you can redistribute it and/or modify
|
|
50
|
+
* it under the terms of the GNU General Public License as published by
|
|
51
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
52
|
+
* (at your option) any later version.
|
|
53
|
+
*
|
|
54
|
+
* This program is distributed in the hope that it will be useful,
|
|
55
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
56
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
57
|
+
* GNU General Public License for more details.
|
|
58
|
+
*
|
|
59
|
+
* You should have received a copy of the GNU General Public License
|
|
60
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
pragma solidity 0.8.30;
|
|
64
|
+
|
|
65
|
+
import { IClaimIssuer } from "@onchain-id/solidity/contracts/interface/IClaimIssuer.sol";
|
|
66
|
+
import { IIdentity } from "@onchain-id/solidity/contracts/interface/IIdentity.sol";
|
|
67
|
+
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
68
|
+
|
|
69
|
+
import { ERC3643EventsLib } from "../../ERC-3643/ERC3643EventsLib.sol";
|
|
70
|
+
import { IERC3643ClaimTopicsRegistry } from "../../ERC-3643/IERC3643ClaimTopicsRegistry.sol";
|
|
71
|
+
import { IERC3643IdentityRegistry } from "../../ERC-3643/IERC3643IdentityRegistry.sol";
|
|
72
|
+
import { IERC3643IdentityRegistryStorage } from "../../ERC-3643/IERC3643IdentityRegistryStorage.sol";
|
|
73
|
+
import { IERC3643TrustedIssuersRegistry } from "../../ERC-3643/IERC3643TrustedIssuersRegistry.sol";
|
|
74
|
+
import { ErrorsLib } from "../../libraries/ErrorsLib.sol";
|
|
75
|
+
import { EventsLib } from "../../libraries/EventsLib.sol";
|
|
76
|
+
import { AgentRoleUpgradeable } from "../../roles/AgentRoleUpgradeable.sol";
|
|
77
|
+
import { IERC173 } from "../../roles/IERC173.sol";
|
|
78
|
+
import { IClaimTopicsRegistry } from "../interface/IClaimTopicsRegistry.sol";
|
|
79
|
+
import { IIdentityRegistry } from "../interface/IIdentityRegistry.sol";
|
|
80
|
+
import { IIdentityRegistryStorage } from "../interface/IIdentityRegistryStorage.sol";
|
|
81
|
+
import { ITrustedIssuersRegistry } from "../interface/ITrustedIssuersRegistry.sol";
|
|
82
|
+
|
|
83
|
+
contract IdentityRegistry is IIdentityRegistry, AgentRoleUpgradeable, IERC165 {
|
|
84
|
+
|
|
85
|
+
/// @custom:storage-location erc7201:ERC3643.storage.IdentityRegistry
|
|
86
|
+
struct Storage {
|
|
87
|
+
IClaimTopicsRegistry tokenTopicsRegistry;
|
|
88
|
+
ITrustedIssuersRegistry tokenIssuersRegistry;
|
|
89
|
+
IIdentityRegistryStorage tokenIdentityStorage;
|
|
90
|
+
bool checksDisabled;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// keccak256(abi.encode(uint256(keccak256("ERC3643.storage.IdentityRegistry")) - 1)) & ~bytes32(uint256(0xff));
|
|
94
|
+
bytes32 private constant STORAGE_LOCATION = 0x0ef1f877833723f95a1d6f26d44eb8729b1f7ecbea0628fd412c7dacaacfe800;
|
|
95
|
+
|
|
96
|
+
constructor() {
|
|
97
|
+
_disableInitializers();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @dev the constructor initiates the Identity Registry smart contract
|
|
102
|
+
* @param trustedIssuersRegistryAddress the trusted issuers registry linked to the Identity Registry
|
|
103
|
+
* @param claimTopicsRegistryAddress the claim topics registry linked to the Identity Registry
|
|
104
|
+
* @param identityStorageAddress the identity registry storage linked to the Identity Registry
|
|
105
|
+
* @param _owner final owner of the Identity Registry (no intermediate factory ownership)
|
|
106
|
+
* @param _irAgents initial set of agents (capped at 5) — granted via the shared internal `_addAgent` helper
|
|
107
|
+
* so the factory can pre-bake the Token's CREATE3 address into the IR at init time
|
|
108
|
+
* emits a `ClaimTopicsRegistrySet` event
|
|
109
|
+
* emits a `TrustedIssuersRegistrySet` event
|
|
110
|
+
* emits an `IdentityStorageSet` event
|
|
111
|
+
*/
|
|
112
|
+
function init(
|
|
113
|
+
address trustedIssuersRegistryAddress,
|
|
114
|
+
address claimTopicsRegistryAddress,
|
|
115
|
+
address identityStorageAddress,
|
|
116
|
+
address _owner,
|
|
117
|
+
address[] calldata _irAgents,
|
|
118
|
+
address _tokenAddress
|
|
119
|
+
) external initializer {
|
|
120
|
+
require(
|
|
121
|
+
trustedIssuersRegistryAddress != address(0) && claimTopicsRegistryAddress != address(0)
|
|
122
|
+
&& identityStorageAddress != address(0),
|
|
123
|
+
ErrorsLib.ZeroAddress()
|
|
124
|
+
);
|
|
125
|
+
require(_irAgents.length <= 5, ErrorsLib.MaxAgentsReached(5));
|
|
126
|
+
Storage storage s = _getStorage();
|
|
127
|
+
s.tokenTopicsRegistry = IClaimTopicsRegistry(claimTopicsRegistryAddress);
|
|
128
|
+
s.tokenIssuersRegistry = ITrustedIssuersRegistry(trustedIssuersRegistryAddress);
|
|
129
|
+
s.tokenIdentityStorage = IIdentityRegistryStorage(identityStorageAddress);
|
|
130
|
+
s.checksDisabled = false;
|
|
131
|
+
|
|
132
|
+
emit ERC3643EventsLib.ClaimTopicsRegistrySet(claimTopicsRegistryAddress);
|
|
133
|
+
emit ERC3643EventsLib.TrustedIssuersRegistrySet(trustedIssuersRegistryAddress);
|
|
134
|
+
emit ERC3643EventsLib.IdentityStorageSet(identityStorageAddress);
|
|
135
|
+
emit EventsLib.EligibilityChecksEnabled();
|
|
136
|
+
|
|
137
|
+
__Ownable_init(_owner);
|
|
138
|
+
|
|
139
|
+
_addAgent(_tokenAddress);
|
|
140
|
+
for (uint256 i = 0; i < _irAgents.length; i++) {
|
|
141
|
+
_addAgent(_irAgents[i]);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @dev See {IIdentityRegistry-batchRegisterIdentity}.
|
|
147
|
+
*/
|
|
148
|
+
function batchRegisterIdentity(
|
|
149
|
+
address[] calldata userAddresses,
|
|
150
|
+
IIdentity[] calldata identities,
|
|
151
|
+
uint16[] calldata countries
|
|
152
|
+
) external override {
|
|
153
|
+
for (uint256 i = 0; i < userAddresses.length; i++) {
|
|
154
|
+
registerIdentity(userAddresses[i], identities[i], countries[i]);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @dev See {IIdentityRegistry-updateIdentity}.
|
|
160
|
+
*/
|
|
161
|
+
function updateIdentity(address userAddress, IIdentity userIdentity) external override onlyAgent {
|
|
162
|
+
IIdentity oldIdentity = identity(userAddress);
|
|
163
|
+
_getStorage().tokenIdentityStorage.modifyStoredIdentity(userAddress, userIdentity);
|
|
164
|
+
emit ERC3643EventsLib.IdentityUpdated(oldIdentity, userIdentity);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @dev See {IIdentityRegistry-updateCountry}.
|
|
169
|
+
*/
|
|
170
|
+
function updateCountry(address _userAddress, uint16 _country) external override onlyAgent {
|
|
171
|
+
_getStorage().tokenIdentityStorage.modifyStoredInvestorCountry(_userAddress, _country);
|
|
172
|
+
emit ERC3643EventsLib.CountryUpdated(_userAddress, _country);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @dev See {IIdentityRegistry-deleteIdentity}.
|
|
177
|
+
*/
|
|
178
|
+
function deleteIdentity(address _userAddress) external override onlyAgent {
|
|
179
|
+
IIdentity oldIdentity = identity(_userAddress);
|
|
180
|
+
_getStorage().tokenIdentityStorage.removeIdentityFromStorage(_userAddress);
|
|
181
|
+
emit ERC3643EventsLib.IdentityRemoved(_userAddress, oldIdentity);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @dev See {IIdentityRegistry-setIdentityRegistryStorage}.
|
|
186
|
+
*/
|
|
187
|
+
function setIdentityRegistryStorage(address _identityRegistryStorage) external override onlyOwner {
|
|
188
|
+
_getStorage().tokenIdentityStorage = IIdentityRegistryStorage(_identityRegistryStorage);
|
|
189
|
+
emit ERC3643EventsLib.IdentityStorageSet(_identityRegistryStorage);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @dev See {IIdentityRegistry-setClaimTopicsRegistry}.
|
|
194
|
+
*/
|
|
195
|
+
function setClaimTopicsRegistry(address _claimTopicsRegistry) external override onlyOwner {
|
|
196
|
+
_getStorage().tokenTopicsRegistry = IClaimTopicsRegistry(_claimTopicsRegistry);
|
|
197
|
+
emit ERC3643EventsLib.ClaimTopicsRegistrySet(_claimTopicsRegistry);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* @dev See {IIdentityRegistry-setTrustedIssuersRegistry}.
|
|
202
|
+
*/
|
|
203
|
+
function setTrustedIssuersRegistry(address _trustedIssuersRegistry) external override onlyOwner {
|
|
204
|
+
_getStorage().tokenIssuersRegistry = ITrustedIssuersRegistry(_trustedIssuersRegistry);
|
|
205
|
+
emit ERC3643EventsLib.TrustedIssuersRegistrySet(_trustedIssuersRegistry);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @dev See {IIdentityRegistry-disableEligibilityChecks}.
|
|
210
|
+
*/
|
|
211
|
+
function disableEligibilityChecks() external override onlyOwner {
|
|
212
|
+
Storage storage s = _getStorage();
|
|
213
|
+
require(!s.checksDisabled, ErrorsLib.EligibilityChecksDisabledAlready());
|
|
214
|
+
s.checksDisabled = true;
|
|
215
|
+
emit EventsLib.EligibilityChecksDisabled();
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @dev See {IIdentityRegistry-enableEligibilityChecks}.
|
|
220
|
+
*/
|
|
221
|
+
function enableEligibilityChecks() external override onlyOwner {
|
|
222
|
+
Storage storage s = _getStorage();
|
|
223
|
+
require(s.checksDisabled, ErrorsLib.EligibilityChecksEnabledAlready());
|
|
224
|
+
s.checksDisabled = false;
|
|
225
|
+
emit EventsLib.EligibilityChecksEnabled();
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @dev See {IIdentityRegistry-isVerified}.
|
|
230
|
+
*/
|
|
231
|
+
// solhint-disable-next-line code-complexity
|
|
232
|
+
function isVerified(address userAddress) external view override returns (bool) {
|
|
233
|
+
Storage storage s = _getStorage();
|
|
234
|
+
|
|
235
|
+
if (s.checksDisabled) return true;
|
|
236
|
+
if (address(identity(userAddress)) == address(0)) return false;
|
|
237
|
+
uint256[] memory requiredClaimTopics = s.tokenTopicsRegistry.getClaimTopics();
|
|
238
|
+
if (requiredClaimTopics.length == 0) {
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
uint256 foundClaimTopic;
|
|
243
|
+
uint256 scheme;
|
|
244
|
+
address issuer;
|
|
245
|
+
bytes memory sig;
|
|
246
|
+
bytes memory data;
|
|
247
|
+
uint256 claimTopic;
|
|
248
|
+
for (claimTopic = 0; claimTopic < requiredClaimTopics.length; claimTopic++) {
|
|
249
|
+
IClaimIssuer[] memory trustedIssuers =
|
|
250
|
+
s.tokenIssuersRegistry.getTrustedIssuersForClaimTopic(requiredClaimTopics[claimTopic]);
|
|
251
|
+
|
|
252
|
+
if (trustedIssuers.length == 0) return false;
|
|
253
|
+
|
|
254
|
+
bytes32[] memory claimIds = new bytes32[](trustedIssuers.length);
|
|
255
|
+
for (uint256 i = 0; i < trustedIssuers.length; i++) {
|
|
256
|
+
claimIds[i] = keccak256(abi.encode(trustedIssuers[i], requiredClaimTopics[claimTopic]));
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
for (uint256 j = 0; j < claimIds.length; j++) {
|
|
260
|
+
(foundClaimTopic, scheme, issuer, sig, data,) = identity(userAddress).getClaim(claimIds[j]);
|
|
261
|
+
|
|
262
|
+
if (foundClaimTopic == requiredClaimTopics[claimTopic]) {
|
|
263
|
+
try IClaimIssuer(issuer)
|
|
264
|
+
.isClaimValid(identity(userAddress), requiredClaimTopics[claimTopic], sig, data) returns (
|
|
265
|
+
bool _validity
|
|
266
|
+
) {
|
|
267
|
+
if (_validity) {
|
|
268
|
+
j = claimIds.length;
|
|
269
|
+
}
|
|
270
|
+
if (!_validity && j == (claimIds.length - 1)) {
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
} catch {
|
|
274
|
+
if (j == (claimIds.length - 1)) {
|
|
275
|
+
return false;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
} else if (j == (claimIds.length - 1)) {
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return true;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* @dev See {IIdentityRegistry-investorCountry}.
|
|
288
|
+
*/
|
|
289
|
+
function investorCountry(address _userAddress) external view override returns (uint16) {
|
|
290
|
+
return _getStorage().tokenIdentityStorage.storedInvestorCountry(_userAddress);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* @dev See {IIdentityRegistry-issuersRegistry}.
|
|
295
|
+
*/
|
|
296
|
+
function issuersRegistry() external view override returns (IERC3643TrustedIssuersRegistry) {
|
|
297
|
+
return _getStorage().tokenIssuersRegistry;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* @dev See {IIdentityRegistry-topicsRegistry}.
|
|
302
|
+
*/
|
|
303
|
+
function topicsRegistry() external view override returns (IERC3643ClaimTopicsRegistry) {
|
|
304
|
+
return _getStorage().tokenTopicsRegistry;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* @dev See {IIdentityRegistry-identityStorage}.
|
|
309
|
+
*/
|
|
310
|
+
function identityStorage() external view override returns (IERC3643IdentityRegistryStorage) {
|
|
311
|
+
return _getStorage().tokenIdentityStorage;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* @dev See {IIdentityRegistry-contains}.
|
|
316
|
+
*/
|
|
317
|
+
function contains(address _userAddress) external view override returns (bool) {
|
|
318
|
+
return address(identity(_userAddress)) != address(0);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* @dev See {IIdentityRegistry-registerIdentity}.
|
|
323
|
+
*/
|
|
324
|
+
function registerIdentity(address _userAddress, IIdentity _identity, uint16 _country) public override onlyAgent {
|
|
325
|
+
_getStorage().tokenIdentityStorage.addIdentityToStorage(_userAddress, _identity, _country);
|
|
326
|
+
emit ERC3643EventsLib.IdentityRegistered(_userAddress, _identity);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @dev See {IIdentityRegistry-identity}.
|
|
331
|
+
*/
|
|
332
|
+
function identity(address _userAddress) public view override returns (IIdentity) {
|
|
333
|
+
return _getStorage().tokenIdentityStorage.storedIdentity(_userAddress);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* @dev See {IERC165-supportsInterface}.
|
|
338
|
+
*/
|
|
339
|
+
function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) {
|
|
340
|
+
return interfaceId == type(IIdentityRegistry).interfaceId
|
|
341
|
+
|| interfaceId == type(IERC3643IdentityRegistry).interfaceId || interfaceId == type(IERC173).interfaceId
|
|
342
|
+
|| interfaceId == type(IERC165).interfaceId;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function _getStorage() internal pure returns (Storage storage s) {
|
|
346
|
+
// solhint-disable-next-line no-inline-assembly
|
|
347
|
+
assembly {
|
|
348
|
+
s.slot := STORAGE_LOCATION
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
}
|