@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.
Files changed (208) hide show
  1. package/LICENSE.md +674 -0
  2. package/README.md +137 -0
  3. package/contracts/ERC-3643/ERC3643EventsLib.sol +150 -0
  4. package/contracts/ERC-3643/IERC3643.sol +408 -0
  5. package/contracts/ERC-3643/IERC3643ClaimTopicsRegistry.sol +66 -0
  6. package/contracts/ERC-3643/IERC3643Compliance.sol +127 -0
  7. package/contracts/ERC-3643/IERC3643IdentityRegistry.sol +180 -0
  8. package/contracts/ERC-3643/IERC3643IdentityRegistryStorage.sol +120 -0
  9. package/contracts/ERC-3643/IERC3643TrustedIssuersRegistry.sol +120 -0
  10. package/contracts/compliance/modular/IModularCompliance.sol +143 -0
  11. package/contracts/compliance/modular/ModularCompliance.sol +381 -0
  12. package/contracts/compliance/modular/modules/AbstractModuleUpgradeable.sol +193 -0
  13. package/contracts/compliance/modular/modules/IModule.sol +158 -0
  14. package/contracts/compliance/modular/modules/ModuleProxy.sol +72 -0
  15. package/contracts/factory/ITREXFactory.sol +180 -0
  16. package/contracts/factory/ITREXGateway.sol +234 -0
  17. package/contracts/factory/TREXFactory.sol +358 -0
  18. package/contracts/factory/TREXGateway.sol +274 -0
  19. package/contracts/libraries/ErrorsLib.sol +168 -0
  20. package/contracts/libraries/EventsLib.sol +147 -0
  21. package/contracts/proxy/AbstractProxy.sol +146 -0
  22. package/contracts/proxy/ClaimTopicsRegistryProxy.sol +83 -0
  23. package/contracts/proxy/IdentityRegistryProxy.sol +95 -0
  24. package/contracts/proxy/IdentityRegistryStorageProxy.sol +83 -0
  25. package/contracts/proxy/ModularComplianceProxy.sol +88 -0
  26. package/contracts/proxy/TokenProxy.sol +97 -0
  27. package/contracts/proxy/TrustedIssuersRegistryProxy.sol +88 -0
  28. package/contracts/proxy/authority/IAFactory.sol +122 -0
  29. package/contracts/proxy/authority/IIAFactory.sol +87 -0
  30. package/contracts/proxy/authority/ITREXImplementationAuthority.sol +239 -0
  31. package/contracts/proxy/authority/TREXImplementationAuthority.sol +350 -0
  32. package/contracts/proxy/interface/IProxy.sol +72 -0
  33. package/contracts/registry/implementation/ClaimTopicsRegistry.sol +152 -0
  34. package/contracts/registry/implementation/IdentityRegistry.sol +352 -0
  35. package/contracts/registry/implementation/IdentityRegistryStorage.sol +227 -0
  36. package/contracts/registry/implementation/TrustedIssuersRegistry.sol +272 -0
  37. package/contracts/registry/interface/IClaimTopicsRegistry.sol +70 -0
  38. package/contracts/registry/interface/IIdentityRegistry.sol +102 -0
  39. package/contracts/registry/interface/IIdentityRegistryStorage.sol +70 -0
  40. package/contracts/registry/interface/ITrustedIssuersRegistry.sol +70 -0
  41. package/contracts/roles/AbstractAgentRole.sol +122 -0
  42. package/contracts/roles/AgentRole.sol +82 -0
  43. package/contracts/roles/AgentRoleUpgradeable.sol +82 -0
  44. package/contracts/roles/IERC173.sol +21 -0
  45. package/contracts/roles/Roles.sol +102 -0
  46. package/contracts/token/IToken.sol +97 -0
  47. package/contracts/token/Token.sol +664 -0
  48. package/contracts/token/TokenStructs.sol +74 -0
  49. package/contracts/utils/IUtilityChecker.sol +135 -0
  50. package/contracts/utils/InterfaceIdCalculator.sol +223 -0
  51. package/contracts/utils/UtilityChecker.sol +210 -0
  52. package/contracts/utils/UtilityCheckerProxy.sol +72 -0
  53. package/contracts/vendor/openzeppelin/Create3.sol +143 -0
  54. package/out/AbstractAgentRole.sol/AbstractAgentRole.json +1 -0
  55. package/out/AbstractModuleUpgradeable.sol/AbstractModuleUpgradeable.json +1 -0
  56. package/out/AbstractProxy.sol/AbstractProxy.json +1 -0
  57. package/out/Address.sol/Address.json +1 -0
  58. package/out/AgentRole.sol/AgentRole.json +1 -0
  59. package/out/AgentRoleUpgradeable.sol/AgentRoleUpgradeable.json +1 -0
  60. package/out/Arrays.sol/Arrays.json +1 -0
  61. package/out/Base.sol/CommonBase.json +1 -0
  62. package/out/Base.sol/ScriptBase.json +1 -0
  63. package/out/Base.sol/TestBase.json +1 -0
  64. package/out/Bytes.sol/Bytes.json +1 -0
  65. package/out/ClaimIssuer.sol/ClaimIssuer.json +1 -0
  66. package/out/ClaimIssuerTrick.sol/ClaimIssuerTrick.json +1 -0
  67. package/out/ClaimTopicsRegistry.sol/ClaimTopicsRegistry.json +1 -0
  68. package/out/ClaimTopicsRegistryProxy.sol/ClaimTopicsRegistryProxy.json +1 -0
  69. package/out/Comparators.sol/Comparators.json +1 -0
  70. package/out/Context.sol/Context.json +1 -0
  71. package/out/ContextUpgradeable.sol/ContextUpgradeable.json +1 -0
  72. package/out/Countries.sol/Countries.json +1 -0
  73. package/out/Create2.sol/Create2.json +1 -0
  74. package/out/Create3.sol/Create3.json +1 -0
  75. package/out/ECDSA.sol/ECDSA.json +1 -0
  76. package/out/EIP712.sol/EIP712.json +1 -0
  77. package/out/EIP712Upgradeable.sol/EIP712Upgradeable.json +1 -0
  78. package/out/ERC1967Proxy.sol/ERC1967Proxy.json +1 -0
  79. package/out/ERC1967Utils.sol/ERC1967Utils.json +1 -0
  80. package/out/ERC20.sol/ERC20.json +1 -0
  81. package/out/ERC20Pausable.sol/ERC20Pausable.json +1 -0
  82. package/out/ERC20PermitUpgradeable.sol/ERC20PermitUpgradeable.json +1 -0
  83. package/out/ERC20Upgradeable.sol/ERC20Upgradeable.json +1 -0
  84. package/out/ERC2771Context.sol/ERC2771Context.json +1 -0
  85. package/out/ERC2771ContextUpgradeable.sol/ERC2771ContextUpgradeable.json +1 -0
  86. package/out/ERC2771Forwarder.sol/ERC2771Forwarder.json +1 -0
  87. package/out/ERC3643EventsLib.sol/ERC3643EventsLib.json +1 -0
  88. package/out/EnumerableSet.sol/EnumerableSet.json +1 -0
  89. package/out/Errors.sol/Errors.json +1 -0
  90. package/out/ErrorsLib.sol/ErrorsLib.json +1 -0
  91. package/out/EventsLib.sol/EventsLib.json +1 -0
  92. package/out/IAFactory.sol/IAFactory.json +1 -0
  93. package/out/IBeacon.sol/IBeacon.json +1 -0
  94. package/out/IClaimIssuer.sol/IClaimIssuer.json +1 -0
  95. package/out/IClaimTopicsRegistry.sol/IClaimTopicsRegistry.json +1 -0
  96. package/out/IERC1363.sol/IERC1363.json +1 -0
  97. package/out/IERC165.sol/IERC165.json +1 -0
  98. package/out/IERC173.sol/IERC173.json +1 -0
  99. package/out/IERC1967.sol/IERC1967.json +1 -0
  100. package/out/IERC20.sol/IERC20.json +1 -0
  101. package/out/IERC20Metadata.sol/IERC20Metadata.json +1 -0
  102. package/out/IERC20Permit.sol/IERC20Permit.json +1 -0
  103. package/out/IERC3643.sol/IERC3643.json +1 -0
  104. package/out/IERC3643ClaimTopicsRegistry.sol/IERC3643ClaimTopicsRegistry.json +1 -0
  105. package/out/IERC3643Compliance.sol/IERC3643Compliance.json +1 -0
  106. package/out/IERC3643IdentityRegistry.sol/IERC3643IdentityRegistry.json +1 -0
  107. package/out/IERC3643IdentityRegistryStorage.sol/IERC3643IdentityRegistryStorage.json +1 -0
  108. package/out/IERC3643TrustedIssuersRegistry.sol/IERC3643TrustedIssuersRegistry.json +1 -0
  109. package/out/IERC5267.sol/IERC5267.json +1 -0
  110. package/out/IERC734.sol/IERC734.json +1 -0
  111. package/out/IERC735.sol/IERC735.json +1 -0
  112. package/out/IIAFactory.sol/IIAFactory.json +1 -0
  113. package/out/IIdFactory.sol/IIdFactory.json +1 -0
  114. package/out/IIdentity.sol/IIdentity.json +1 -0
  115. package/out/IIdentityRegistry.sol/IIdentityRegistry.json +1 -0
  116. package/out/IIdentityRegistryStorage.sol/IIdentityRegistryStorage.json +1 -0
  117. package/out/IImplementationAuthority.sol/IImplementationAuthority.json +1 -0
  118. package/out/IModularCompliance.sol/IModularCompliance.json +1 -0
  119. package/out/IModule.sol/IModule.json +1 -0
  120. package/out/IMulticall3.sol/IMulticall3.json +1 -0
  121. package/out/IProxy.sol/IProxy.json +1 -0
  122. package/out/ITREXFactory.sol/ITREXFactory.json +1 -0
  123. package/out/ITREXGateway.sol/ITREXGateway.json +1 -0
  124. package/out/ITREXImplementationAuthority.sol/ITREXImplementationAuthority.json +1 -0
  125. package/out/IToken.sol/IToken.json +1 -0
  126. package/out/ITrustedIssuersRegistry.sol/ITrustedIssuersRegistry.json +1 -0
  127. package/out/IUtilityChecker.sol/IUtilityChecker.json +1 -0
  128. package/out/IdFactory.sol/IdFactory.json +1 -0
  129. package/out/Identity.sol/Identity.json +1 -0
  130. package/out/IdentityProxy.sol/IdentityProxy.json +1 -0
  131. package/out/IdentityRegistry.sol/IdentityRegistry.json +1 -0
  132. package/out/IdentityRegistryProxy.sol/IdentityRegistryProxy.json +1 -0
  133. package/out/IdentityRegistryStorage.sol/IdentityRegistryStorage.json +1 -0
  134. package/out/IdentityRegistryStorageProxy.sol/IdentityRegistryStorageProxy.json +1 -0
  135. package/out/ImplementationAuthority.sol/ImplementationAuthority.json +1 -0
  136. package/out/Initializable.sol/Initializable.json +1 -0
  137. package/out/InterfaceIdCalculator.sol/InterfaceIdCalculator.json +1 -0
  138. package/out/KeyPurposes.sol/KeyPurposes.json +1 -0
  139. package/out/KeyTypes.sol/KeyTypes.json +1 -0
  140. package/out/LowLevelCall.sol/LowLevelCall.json +1 -0
  141. package/out/Math.sol/Math.json +1 -0
  142. package/out/MessageHashUtils.sol/MessageHashUtils.json +1 -0
  143. package/out/ModularCompliance.sol/ModularCompliance.json +1 -0
  144. package/out/ModularComplianceProxy.sol/ModularComplianceProxy.json +1 -0
  145. package/out/ModuleNotPnP.sol/ModuleNotPnP.json +1 -0
  146. package/out/ModuleProxy.sol/ModuleProxy.json +1 -0
  147. package/out/MulticallUpgradeable.sol/MulticallUpgradeable.json +1 -0
  148. package/out/Nonces.sol/Nonces.json +1 -0
  149. package/out/NoncesUpgradeable.sol/NoncesUpgradeable.json +1 -0
  150. package/out/Ownable.sol/Ownable.json +1 -0
  151. package/out/Ownable2Step.sol/Ownable2Step.json +1 -0
  152. package/out/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.json +1 -0
  153. package/out/OwnableUpgradeable.sol/OwnableUpgradeable.json +1 -0
  154. package/out/Panic.sol/Panic.json +1 -0
  155. package/out/Pausable.sol/Pausable.json +1 -0
  156. package/out/PausableUpgradeable.sol/PausableUpgradeable.json +1 -0
  157. package/out/Proxy.sol/Proxy.json +1 -0
  158. package/out/Roles.sol/Roles.json +1 -0
  159. package/out/SafeCast.sol/SafeCast.json +1 -0
  160. package/out/SafeERC20.sol/SafeERC20.json +1 -0
  161. package/out/ShortStrings.sol/ShortStrings.json +1 -0
  162. package/out/SignedMath.sol/SignedMath.json +1 -0
  163. package/out/SlotDerivation.sol/SlotDerivation.json +1 -0
  164. package/out/StdAssertions.sol/StdAssertions.json +1 -0
  165. package/out/StdChains.sol/StdChains.json +1 -0
  166. package/out/StdCheats.sol/StdCheats.json +1 -0
  167. package/out/StdCheats.sol/StdCheatsSafe.json +1 -0
  168. package/out/StdConstants.sol/StdConstants.json +1 -0
  169. package/out/StdError.sol/stdError.json +1 -0
  170. package/out/StdInvariant.sol/StdInvariant.json +1 -0
  171. package/out/StdJson.sol/stdJson.json +1 -0
  172. package/out/StdMath.sol/stdMath.json +1 -0
  173. package/out/StdStorage.sol/stdStorage.json +1 -0
  174. package/out/StdStorage.sol/stdStorageSafe.json +1 -0
  175. package/out/StdStyle.sol/StdStyle.json +1 -0
  176. package/out/StdToml.sol/stdToml.json +1 -0
  177. package/out/StdUtils.sol/StdUtils.json +1 -0
  178. package/out/Storage.sol/Storage.json +1 -0
  179. package/out/StorageSlot.sol/StorageSlot.json +1 -0
  180. package/out/Strings.sol/Strings.json +1 -0
  181. package/out/Structs.sol/Structs.json +1 -0
  182. package/out/TREXFactory.sol/TREXFactory.json +1 -0
  183. package/out/TREXGateway.sol/TREXGateway.json +1 -0
  184. package/out/TREXImplementationAuthority.sol/TREXImplementationAuthority.json +1 -0
  185. package/out/TestAgentRole.sol/TestAgentRole.json +1 -0
  186. package/out/TestAgentRoleUpgradeable.sol/TestAgentRoleUpgradeable.json +1 -0
  187. package/out/TestERC20.sol/TestERC20.json +1 -0
  188. package/out/TestModule.sol/TestModule.json +1 -0
  189. package/out/TestTREXFactory.sol/TestTREXFactory.json +1 -0
  190. package/out/Token.sol/Token.json +1 -0
  191. package/out/TokenProxy.sol/TokenProxy.json +1 -0
  192. package/out/TrustedIssuersRegistry.sol/TrustedIssuersRegistry.json +1 -0
  193. package/out/TrustedIssuersRegistryProxy.sol/TrustedIssuersRegistryProxy.json +1 -0
  194. package/out/UUPSUpgradeable.sol/UUPSUpgradeable.json +1 -0
  195. package/out/UtilityChecker.sol/UtilityChecker.json +1 -0
  196. package/out/UtilityCheckerProxy.sol/UtilityCheckerProxy.json +1 -0
  197. package/out/Utils.sol/Utils.json +1 -0
  198. package/out/Version.sol/Version.json +1 -0
  199. package/out/Vm.sol/Vm.json +1 -0
  200. package/out/Vm.sol/VmSafe.json +1 -0
  201. package/out/console.sol/console.json +1 -0
  202. package/out/draft-IERC1822.sol/IERC1822Proxiable.json +1 -0
  203. package/out/draft-IERC6093.sol/IERC1155Errors.json +1 -0
  204. package/out/draft-IERC6093.sol/IERC20Errors.json +1 -0
  205. package/out/draft-IERC6093.sol/IERC721Errors.json +1 -0
  206. package/out/libraries/Errors.sol/Errors.json +1 -0
  207. package/out/safeconsole.sol/safeconsole.json +1 -0
  208. package/package.json +47 -0
@@ -0,0 +1,168 @@
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
+ /**
41
+ * NOTICE
42
+ *
43
+ * The T-REX software is licensed under a proprietary license or the GPL v.3.
44
+ * If you choose to receive it under the GPL v.3 license, the following applies:
45
+ * T-REX is a suite of smart contracts implementing the ERC-3643 standard and
46
+ * developed by Tokeny to manage and transfer financial assets on EVM blockchains
47
+ *
48
+ * Copyright (C) 2025, Tokeny sàrl.
49
+ *
50
+ * This program is free software: you can redistribute it and/or modify
51
+ * it under the terms of the GNU General Public License as published by
52
+ * the Free Software Foundation, either version 3 of the License, or
53
+ * (at your option) any later version.
54
+ *
55
+ * This program is distributed in the hope that it will be useful,
56
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
57
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58
+ * GNU General Public License for more details.
59
+ *
60
+ * You should have received a copy of the GNU General Public License
61
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
62
+ */
63
+
64
+ pragma solidity 0.8.30;
65
+
66
+ library ErrorsLib {
67
+
68
+ // Common Errors
69
+ error ZeroAddress();
70
+ error ZeroValue();
71
+ error ArraySizeLimited(uint256 maxSize);
72
+ error InitializationFailed();
73
+ error InvalidImplementationAuthority();
74
+
75
+ // Token Errors
76
+ error AddressNotAgent(address agent);
77
+ error AgentNotAuthorized(address agent, string reason);
78
+ error AmountAboveFrozenTokens(uint256 amount, uint256 maxAmount);
79
+ error ComplianceNotFollowed();
80
+ error DefaultAllowanceOptOutAlreadySet(address user, bool optOut);
81
+ error DefaultAllowanceAlreadySet(address spender, bool allowed);
82
+ error DecimalsOutOfRange(uint256 decimals);
83
+ error EmptyString();
84
+ error FrozenWallet(address user);
85
+ error NoTokenToRecover();
86
+ error RecoveryNotPossible();
87
+ error UnverifiedIdentity();
88
+
89
+ // ModularCompliance Errors
90
+ error AddressNotATokenBoundToComplianceContract();
91
+ error ComplianceNotSuitableForBindingToModule(address module);
92
+ error MaxModulesReached(uint256 maxValue);
93
+ error ModuleAlreadyBound();
94
+ error ModuleNotBound();
95
+ error OnlyOwnerOrTokenCanCall();
96
+ error TokenNotBound();
97
+
98
+ // Module Errors
99
+ error ComplianceNotBound();
100
+ error ComplianceAlreadyBound();
101
+ error OnlyBoundComplianceCanCall();
102
+ error OnlyComplianceContractCanCall();
103
+
104
+ // TREXGateway Errors
105
+ error SenderIsNotAdmin();
106
+ error PublicDeploymentAlreadyEnabled();
107
+ error PublicDeploymentAlreadyDisabled();
108
+ error DeploymentFeesAlreadyEnabled();
109
+ error DeploymentFeesAlreadyDisabled();
110
+ error DeployerAlreadyExists(address deployer);
111
+ error DeployerDoesNotExist(address deployer);
112
+ error PublicDeploymentsNotAllowed();
113
+ error PublicCannotDeployOnBehalf();
114
+ error DiscountOutOfRange();
115
+
116
+ // TREXFactory Errors
117
+ error AddressPredictionMismatch();
118
+ error InvalidClaimPattern();
119
+ error InvalidCompliancePattern();
120
+ error MaxClaimIssuersReached(uint256 max);
121
+ error MaxClaimTopicsReached(uint256 max);
122
+ error MaxAgentsReached(uint256 max);
123
+ error MaxModuleActionsReached(uint256 max);
124
+ error TokenAlreadyDeployed();
125
+
126
+ // Roles Errors
127
+ error AccountAlreadyHasRole();
128
+ error AccountDoesNotHaveRole();
129
+ error CallerDoesNotHaveAgentRole();
130
+
131
+ // ClaimTopicsRegistry Errors
132
+ error ClaimTopicAlreadyExists();
133
+ error MaxTopicsReached(uint256 max);
134
+
135
+ // IdentityRegistry Errors
136
+ error EligibilityChecksDisabledAlready();
137
+ error EligibilityChecksEnabledAlready();
138
+
139
+ // IdentityRegistryStorage Errors
140
+ error AddressAlreadyStored();
141
+ error AddressNotYetStored();
142
+ error IdentityRegistryNotStored();
143
+ error MaxIRByIRSReached(uint256 max);
144
+
145
+ // TrustedIssuersRegistry Errors
146
+ error ClaimTopicsCannotBeEmpty();
147
+ error MaxClaimTopcisReached(uint256 max);
148
+ error MaxTrustedIssuersReached(uint256 max);
149
+ error NotATrustedIssuer();
150
+ error TrustedClaimTopicsCannotBeEmpty();
151
+ error TrustedIssuerAlreadyExists();
152
+ error TrustedIssuerDoesNotExist();
153
+
154
+ // TREXImplementationAuthority Errors
155
+ error CallerNotOwnerOfAllImpactedContracts();
156
+ error CannotCallOnReferenceContract();
157
+ error NewIAIsNotAReferenceContract();
158
+ error NonExistingVersion();
159
+ error OnlyReferenceContractCanCall();
160
+ error VersionAlreadyFetched();
161
+ error VersionAlreadyExists();
162
+ error VersionAlreadyInUse();
163
+ error VersionOfNewIAMustBeTheSameAsCurrentIA();
164
+
165
+ // AbstractProxy Errors
166
+ error OnlyCurrentImplementationAuthorityCanCall();
167
+
168
+ }
@@ -0,0 +1,147 @@
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
+ /**
41
+ * NOTICE
42
+ *
43
+ * The T-REX software is licensed under a proprietary license or the GPL v.3.
44
+ * If you choose to receive it under the GPL v.3 license, the following applies:
45
+ * T-REX is a suite of smart contracts implementing the ERC-3643 standard and
46
+ * developed by Tokeny to manage and transfer financial assets on EVM blockchains
47
+ *
48
+ * Copyright (C) 2025, Tokeny sàrl.
49
+ *
50
+ * This program is free software: you can redistribute it and/or modify
51
+ * it under the terms of the GNU General Public License as published by
52
+ * the Free Software Foundation, either version 3 of the License, or
53
+ * (at your option) any later version.
54
+ *
55
+ * This program is distributed in the hope that it will be useful,
56
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
57
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58
+ * GNU General Public License for more details.
59
+ *
60
+ * You should have received a copy of the GNU General Public License
61
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
62
+ */
63
+ pragma solidity 0.8.30;
64
+
65
+ import { ITREXImplementationAuthority } from "../proxy/authority/ITREXImplementationAuthority.sol";
66
+
67
+ library EventsLib {
68
+
69
+ // Common Events
70
+
71
+ event ImplementationAuthoritySet(address implementationAuthority);
72
+
73
+ // AgentRole / AgentRoleUpgradeable Events
74
+
75
+ event AgentAdded(address indexed agent);
76
+ event AgentRemoved(address indexed agent);
77
+
78
+ // Token Events
79
+
80
+ event AgentRestrictionsSet(
81
+ address indexed agent,
82
+ bool disableMint,
83
+ bool disableBurn,
84
+ bool disableAddressFreeze,
85
+ bool disableForceTransfer,
86
+ bool disablePartialFreeze,
87
+ bool disablePause,
88
+ bool disableRecovery
89
+ );
90
+ event DefaultAllowanceUpdated(address to, bool allowance, address updater);
91
+ event DefaultAllowanceOptOutUpdated(address user, bool optOut);
92
+ event TrustedForwarderSet(address indexed trustedForwarder);
93
+
94
+ // ModularCompliance Events
95
+
96
+ event ModuleInteraction(address indexed target, bytes4 selector);
97
+ event ModuleAdded(address indexed module);
98
+ event ModuleRemoved(address indexed module);
99
+
100
+ // AbstractModule / AbstractModuleUpgradeable Events
101
+
102
+ event ComplianceBound(address indexed compliance);
103
+ event ComplianceUnbound(address indexed compliance);
104
+
105
+ // IdentityRegistry Events
106
+
107
+ event EligibilityChecksDisabled();
108
+ event EligibilityChecksEnabled();
109
+
110
+ // TREXFactory Events
111
+
112
+ event Deployed(address indexed addr);
113
+ event IdFactorySet(address idFactory);
114
+ event TREXSuiteDeployed(
115
+ address indexed token, address ir, address irs, address tir, address ctr, address mc, string salt
116
+ );
117
+
118
+ // TREXGateway Events
119
+
120
+ event FactorySet(address indexed factory);
121
+ event PublicDeploymentStatusSet(bool indexed publicDeploymentStatus);
122
+ event DeploymentFeeSet(uint256 indexed fee, address indexed feeToken, address indexed feeCollector);
123
+ event DeploymentFeeEnabled(bool indexed isEnabled);
124
+ event DeployerAdded(address indexed deployer);
125
+ event DeployerRemoved(address indexed deployer);
126
+ event FeeDiscountApplied(address indexed deployer, uint16 discount);
127
+ event GatewaySuiteDeploymentProcessed(address indexed requester, address intendedOwner, uint256 feeApplied);
128
+
129
+ // TREXImplementationAuthority Events
130
+
131
+ event TREXVersionAdded(
132
+ ITREXImplementationAuthority.Version indexed version, ITREXImplementationAuthority.TREXContracts indexed trex
133
+ );
134
+ event TREXVersionFetched(
135
+ ITREXImplementationAuthority.Version indexed version, ITREXImplementationAuthority.TREXContracts indexed trex
136
+ );
137
+ event VersionUpdated(ITREXImplementationAuthority.Version indexed version);
138
+ event ImplementationAuthoritySetWithStatus(bool referenceStatus, address trexFactory);
139
+ event TREXFactorySet(address indexed trexFactory);
140
+ event IAFactorySet(address indexed iaFactory);
141
+ event ImplementationAuthorityChanged(address indexed token, address indexed newImplementationAuthority);
142
+
143
+ // IAFactory Events
144
+
145
+ event ImplementationAuthorityDeployed(address indexed ia);
146
+
147
+ }
@@ -0,0 +1,146 @@
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 { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
66
+
67
+ import { ErrorsLib } from "../libraries/ErrorsLib.sol";
68
+ import { EventsLib } from "../libraries/EventsLib.sol";
69
+ import { ITREXImplementationAuthority } from "./authority/ITREXImplementationAuthority.sol";
70
+ import { IProxy } from "./interface/IProxy.sol";
71
+
72
+ abstract contract AbstractProxy is IProxy, Initializable {
73
+
74
+ constructor(address implementationAuthority) {
75
+ require(implementationAuthority != address(0), ErrorsLib.ZeroAddress());
76
+ _storeImplementationAuthority(implementationAuthority);
77
+ emit EventsLib.ImplementationAuthoritySet(implementationAuthority);
78
+ }
79
+
80
+ /**
81
+ * @dev See {IProxy-setImplementationAuthority}.
82
+ */
83
+ function setImplementationAuthority(address _newImplementationAuthority) external override {
84
+ require(msg.sender == getImplementationAuthority(), ErrorsLib.OnlyCurrentImplementationAuthorityCanCall());
85
+ require(_newImplementationAuthority != address(0), ErrorsLib.ZeroAddress());
86
+ require(
87
+ (ITREXImplementationAuthority(_newImplementationAuthority)).getTokenImplementation() != address(0)
88
+ && (ITREXImplementationAuthority(_newImplementationAuthority)).getCTRImplementation() != address(0)
89
+ && (ITREXImplementationAuthority(_newImplementationAuthority)).getIRImplementation() != address(0)
90
+ && (ITREXImplementationAuthority(_newImplementationAuthority)).getIRSImplementation() != address(0)
91
+ && (ITREXImplementationAuthority(_newImplementationAuthority)).getMCImplementation() != address(0)
92
+ && (ITREXImplementationAuthority(_newImplementationAuthority)).getTIRImplementation() != address(0),
93
+ ErrorsLib.InvalidImplementationAuthority()
94
+ );
95
+ _storeImplementationAuthority(_newImplementationAuthority);
96
+ emit EventsLib.ImplementationAuthoritySet(_newImplementationAuthority);
97
+ }
98
+
99
+ /**
100
+ * @dev See {IProxy-getImplementationAuthority}.
101
+ */
102
+ function getImplementationAuthority() public view override returns (address) {
103
+ address implemAuth;
104
+ // solhint-disable-next-line no-inline-assembly
105
+ assembly {
106
+ implemAuth := sload(0x821f3e4d3d679f19eacc940c87acf846ea6eae24a63058ea750304437a62aafc)
107
+ }
108
+ return implemAuth;
109
+ }
110
+
111
+ /**
112
+ * @dev store the implementationAuthority contract address using the ERC-3643 implementation slot in storage
113
+ * the slot storage is the result of `keccak256("ERC-3643.proxy.beacon")`
114
+ */
115
+ function _storeImplementationAuthority(address implementationAuthority) internal {
116
+ // solhint-disable-next-line no-inline-assembly
117
+ assembly {
118
+ sstore(0x821f3e4d3d679f19eacc940c87acf846ea6eae24a63058ea750304437a62aafc, implementationAuthority)
119
+ }
120
+ }
121
+
122
+ function getLogic() internal view virtual returns (address);
123
+
124
+ // solhint-disable-next-line no-complex-fallback
125
+ fallback() external payable {
126
+ address logic = getLogic();
127
+
128
+ // solhint-disable-next-line no-inline-assembly
129
+ assembly {
130
+ calldatacopy(0x0, 0x0, calldatasize())
131
+ let success := delegatecall(gas(), logic, 0x0, calldatasize(), 0, 0)
132
+ let retSz := returndatasize()
133
+ returndatacopy(0, 0, retSz)
134
+ switch success
135
+ case 0 {
136
+ revert(0, retSz)
137
+ }
138
+ default {
139
+ return(0, retSz)
140
+ }
141
+ }
142
+ }
143
+
144
+ receive() external payable { }
145
+
146
+ }
@@ -0,0 +1,83 @@
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 { ErrorsLib } from "../libraries/ErrorsLib.sol";
66
+ import { ClaimTopicsRegistry } from "../registry/implementation/ClaimTopicsRegistry.sol";
67
+ import { AbstractProxy } from "./AbstractProxy.sol";
68
+ import { ITREXImplementationAuthority } from "./authority/ITREXImplementationAuthority.sol";
69
+
70
+ contract ClaimTopicsRegistryProxy is AbstractProxy {
71
+
72
+ constructor(address implementationAuthority, address _owner, uint256[] memory _initialTopics)
73
+ AbstractProxy(implementationAuthority)
74
+ {
75
+ (bool success,) = getLogic().delegatecall(abi.encodeCall(ClaimTopicsRegistry.init, (_owner, _initialTopics)));
76
+ require(success, ErrorsLib.InitializationFailed());
77
+ }
78
+
79
+ function getLogic() internal view override returns (address) {
80
+ return (ITREXImplementationAuthority(getImplementationAuthority())).getCTRImplementation();
81
+ }
82
+
83
+ }
@@ -0,0 +1,95 @@
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 { ErrorsLib } from "../libraries/ErrorsLib.sol";
66
+ import { IdentityRegistry } from "../registry/implementation/IdentityRegistry.sol";
67
+ import { AbstractProxy } from "./AbstractProxy.sol";
68
+ import { ITREXImplementationAuthority } from "./authority/ITREXImplementationAuthority.sol";
69
+
70
+ contract IdentityRegistryProxy is AbstractProxy {
71
+
72
+ constructor(
73
+ address implementationAuthority,
74
+ address _trustedIssuersRegistry,
75
+ address _claimTopicsRegistry,
76
+ address _identityStorage,
77
+ address _owner,
78
+ address[] memory _irAgents,
79
+ address _tokenAddress
80
+ ) AbstractProxy(implementationAuthority) {
81
+ (bool success,) = getLogic()
82
+ .delegatecall(
83
+ abi.encodeCall(
84
+ IdentityRegistry.init,
85
+ (_trustedIssuersRegistry, _claimTopicsRegistry, _identityStorage, _owner, _irAgents, _tokenAddress)
86
+ )
87
+ );
88
+ require(success, ErrorsLib.InitializationFailed());
89
+ }
90
+
91
+ function getLogic() internal view override returns (address) {
92
+ return (ITREXImplementationAuthority(getImplementationAuthority())).getIRImplementation();
93
+ }
94
+
95
+ }