@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,408 @@
1
+ // SPDX-License-Identifier: CC0-1.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
+ pragma solidity 0.8.30;
41
+
42
+ import { IERC3643Compliance } from "./IERC3643Compliance.sol";
43
+ import { IERC3643IdentityRegistry } from "./IERC3643IdentityRegistry.sol";
44
+ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
45
+ import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
46
+
47
+ interface IERC3643 is IERC20, IERC20Metadata {
48
+
49
+ /// Functions
50
+ /// Setters
51
+ /**
52
+ * @dev sets the token name
53
+ * @param _name the name of token to set
54
+ * Only the owner of the token smart contract can call this function
55
+ * emits a `UpdatedTokenInformation` event
56
+ */
57
+ function setName(string calldata _name) external;
58
+
59
+ /**
60
+ * @dev sets the token symbol
61
+ * @param _symbol the token symbol to set
62
+ * Only the owner of the token smart contract can call this function
63
+ * emits a `UpdatedTokenInformation` event
64
+ */
65
+ function setSymbol(string calldata _symbol) external;
66
+
67
+ /**
68
+ * @dev sets the onchain ID of the token
69
+ * @param _onchainID the address of the onchain ID to set
70
+ * Only the owner of the token smart contract can call this function
71
+ * emits a `UpdatedTokenInformation` event
72
+ */
73
+ function setOnchainID(address _onchainID) external;
74
+
75
+ /**
76
+ * @dev Pauses the token contract. When the contract is paused, investors cannot transfer tokens anymore.
77
+ * This function can only be called by an agent of the token, provided the agent is not restricted from pausing the token.
78
+ * emits a `Paused` event upon successful execution.
79
+ * To pause token transfers, the calling agent must have pausing capabilities enabled.
80
+ * If the agent is disabled from pausing, the function call will fail.
81
+ * The function can be called only when the contract is not already paused.
82
+ * error AgentNotAuthorized - Thrown if the agent is disabled from pausing the token,
83
+ * indicating they do not have the necessary permissions to execute this function.
84
+ */
85
+ function pause() external;
86
+
87
+ /**
88
+ * @dev Unpauses the token contract, allowing investors to resume token transfers under normal conditions
89
+ * This function can only be called by an agent of the token, provided the agent is not restricted from pausing the token.
90
+ * emits an `Unpaused` event upon successful execution.
91
+ * To unpause token transfers, the calling agent must have pausing capabilities enabled.
92
+ * If the agent is disabled from pausing, the function call will fail.
93
+ * The function can be called only when the contract is currently paused.
94
+ * error AgentNotAuthorized - Thrown if the agent is disabled from pausing the token,
95
+ * indicating they do not have the necessary permissions to execute this function.
96
+ */
97
+ function unpause() external;
98
+
99
+ /**
100
+ * @dev Sets an address's frozen status for this token,
101
+ * either freezing or unfreezing the address based on the provided boolean value.
102
+ * This function can be called by an agent of the token, assuming the agent is not restricted from freezing addresses.
103
+ * emits an `AddressFrozen` event upon successful execution.
104
+ * @param _userAddress The address for which to update the frozen status.
105
+ * @param _freeze The frozen status to be applied: `true` to freeze, `false` to unfreeze.
106
+ * @notice To change an address's frozen status, the calling agent must have the capability to freeze addresses enabled.
107
+ * If the agent is disabled from freezing addresses, the function call will fail.
108
+ * error AgentNotAuthorized - Thrown if the agent is disabled from freezing addresses,
109
+ * indicating they do not have the necessary permissions to execute this function.
110
+ */
111
+ function setAddressFrozen(address _userAddress, bool _freeze) external;
112
+
113
+ /**
114
+ * @dev Freezes a specified token amount for a given address, preventing those tokens from being transferred.
115
+ * This function can be called by an agent of the token, provided the agent is not restricted from freezing tokens.
116
+ * emits a `TokensFrozen` event upon successful execution.
117
+ * @param _userAddress The address for which to freeze tokens.
118
+ * @param _amount The amount of tokens to be frozen.
119
+ * @notice To freeze tokens for an address, the calling agent must have the capability to freeze tokens enabled.
120
+ * If the agent is disabled from freezing tokens, the function call will fail.
121
+ * error AgentNotAuthorized - Thrown if the agent is disabled from freezing tokens,
122
+ * indicating they do not have the necessary permissions to execute this function.
123
+ */
124
+ function freezePartialTokens(address _userAddress, uint256 _amount) external;
125
+
126
+ /**
127
+ * @dev Unfreezes a specified token amount for a given address, allowing those tokens to be transferred again.
128
+ * This function can be called by an agent of the token, assuming the agent is not restricted from unfreezing tokens.
129
+ * emits a `TokensUnfrozen` event upon successful execution.
130
+ * @param _userAddress The address for which to unfreeze tokens.
131
+ * @param _amount The amount of tokens to be unfrozen.
132
+ * @notice To unfreeze tokens for an address, the calling agent must have the capability to unfreeze tokens enabled.
133
+ * If the agent is disabled from unfreezing tokens, the function call will fail.
134
+ * error AgentNotAuthorized - Thrown if the agent is disabled from unfreezing tokens,
135
+ * indicating they do not have the necessary permissions to execute this function.
136
+ */
137
+ function unfreezePartialTokens(address _userAddress, uint256 _amount) external;
138
+
139
+ /**
140
+ * @dev sets the Identity Registry for the token
141
+ * @param _identityRegistry the address of the Identity Registry to set
142
+ * Only the owner of the token smart contract can call this function
143
+ * emits an `IdentityRegistryAdded` event
144
+ */
145
+ function setIdentityRegistry(address _identityRegistry) external;
146
+
147
+ /**
148
+ * @dev sets the compliance contract of the token
149
+ * @param _compliance the address of the compliance contract to set
150
+ * Only the owner of the token smart contract can call this function
151
+ * calls bindToken on the compliance contract
152
+ * emits a `ComplianceAdded` event
153
+ */
154
+ function setCompliance(address _compliance) external;
155
+
156
+ /// Transfer Actions
157
+
158
+ /**
159
+ * @dev Initiates a forced transfer of tokens between two whitelisted wallets.
160
+ * If the `from` address does not have sufficient free tokens (unfrozen tokens)
161
+ * but possesses a total balance equal to or greater than the specified `amount`,
162
+ * the frozen token amount is reduced to ensure enough free tokens for the transfer.
163
+ * In such cases, the remaining balance in the `from` account consists entirely of frozen tokens post-transfer.
164
+ * It is imperative that the `to` address is a verified and whitelisted address.
165
+ * @param _from The address of the sender.
166
+ * @param _to The address of the receiver.
167
+ * @param _amount The number of tokens to be transferred.
168
+ * This function can only be invoked by a wallet designated as an agent of the token,
169
+ * provided the agent is not restricted from initiating forced transfers of the token.
170
+ * Emits a `TokensUnfrozen` event if `_amount` is higher than the free balance of `_from`.
171
+ * Also emits a `Transfer` event.
172
+ * To execute this function, the calling agent must not be restricted from initiating forced transfers of the token.
173
+ * If the agent is restricted from this capability, the function call will fail.
174
+ * The function can only be called when the contract is not already paused.
175
+ * error `AgentNotAuthorized` - Thrown if the agent is restricted from initiating forced transfers of the token,
176
+ * indicating they do not have the necessary permissions to execute this function.
177
+ */
178
+ function forcedTransfer(address _from, address _to, uint256 _amount) external returns (bool);
179
+
180
+ /**
181
+ * @dev Mints tokens to a specified address.
182
+ * This enhanced version of the default mint method allows tokens to be minted
183
+ * to an address only if it is a verified and whitelisted address according to the security token.
184
+ * @param _to Address to mint the tokens to.
185
+ * @param _amount Amount of tokens to mint.
186
+ * This function can only be called by a wallet designated as an agent of the token,
187
+ * provided the agent is not restricted from minting tokens.
188
+ * Emits a `Transfer` event upon successful minting.
189
+ * To execute this function, the calling agent must not be restricted from minting tokens.
190
+ * If the agent is restricted from this capability, the function call will fail.
191
+ */
192
+ function mint(address _to, uint256 _amount) external;
193
+
194
+ /**
195
+ * @dev Burns tokens from a specified address.
196
+ * If the account address does not have sufficient free tokens (unfrozen tokens)
197
+ * but possesses a total balance equal to or greater than the specified value,
198
+ * the frozen token amount is reduced to ensure enough free tokens for the burn.
199
+ * In such cases, the remaining balance in the account consists entirely of frozen tokens post-transaction.
200
+ * @param _userAddress Address to burn the tokens from.
201
+ * @param _amount Amount of tokens to burn.
202
+ * This function can only be called by a wallet designated as an agent of the token,
203
+ * provided the agent is not restricted from burning tokens.
204
+ * Emits a `TokensUnfrozen` event if `_amount` exceeds the free balance of `_userAddress`.
205
+ * Also emits a `Transfer` event.
206
+ * To execute this function, the calling agent must not be restricted from burning tokens.
207
+ * If the agent is restricted from this capability, the function call will fail.
208
+ */
209
+ function burn(address _userAddress, uint256 _amount) external;
210
+
211
+ /**
212
+ * @dev Initiates a recovery process to transfer tokens and associated states
213
+ * from a lost wallet to a new wallet for an investor.
214
+ *
215
+ * This function allows an authorized agent to recover tokens from a lost wallet,
216
+ * transferring them to a new wallet while preserving the investor's
217
+ * identity and status within the token ecosystem. The function ensures that all relevant data,
218
+ * including frozen tokens and address freezing status, is accurately transferred to the new wallet.
219
+ *
220
+ * @param _lostWallet The wallet that the investor lost, containing the tokens to be recovered.
221
+ * @param _newWallet The newly provided wallet to which tokens and associated statuses must be transferred.
222
+ * @param _investorOnchainID The ONCHAINID of the investor whose tokens are being recovered.
223
+ *
224
+ * Requirements:
225
+ * - The caller must be an agent authorized to perform recovery operations, with no restrictions on this capability.
226
+ * - The `_lostWallet` must have a non-zero token balance; otherwise, the recovery is unnecessary and will revert.
227
+ * - Either the `_lostWallet` or the `_newWallet` must be present in the identity registry;
228
+ * if neither is present, the function will revert.
229
+ *
230
+ * Operations:
231
+ * - Transfers the entire token balance from `_lostWallet` to `_newWallet`.
232
+ * - Transfers any frozen tokens from `_lostWallet` to `_newWallet`, updating the frozen token count accordingly.
233
+ * - Transfers the address freeze status from `_lostWallet` to `_newWallet`,
234
+ * ensuring the new wallet retains any restrictions if applicable.
235
+ * - Updates the identity registry:
236
+ * - If `_lostWallet` is listed in the identity registry, it will be removed,
237
+ * and `_newWallet` will be registered unless already present.
238
+ *
239
+ * Emits the following events:
240
+ * - `TokensUnfrozen` if there are frozen tokens on `_lostWallet` that are transferred.
241
+ * - `TokensFrozen` if frozen tokens are added to `_newWallet`.
242
+ * - `AddressFrozen` if the freeze status of either wallet changes.
243
+ * - `Transfer` to reflect the movement of tokens from `_lostWallet` to `_newWallet`.
244
+ * - `RecoverySuccess` upon successful completion of the recovery process.
245
+ *
246
+ * Reverts if:
247
+ * - The agent calling the function does not have the necessary permissions to perform recovery (`AgentNotAuthorized`).
248
+ * - The `_lostWallet` has no tokens to recover (`NoTokenToRecover`).
249
+ * - Neither `_lostWallet` nor `_newWallet` is present in the identity registry (`RecoveryNotPossible`).
250
+ *
251
+ * @return A boolean value indicating whether the recovery process was successful.
252
+ */
253
+ function recoveryAddress(address _lostWallet, address _newWallet, address _investorOnchainID)
254
+ external
255
+ returns (bool);
256
+
257
+ /// Batch Actions
258
+
259
+ /**
260
+ * @dev function allowing to issue transfers in batch
261
+ * Require that the msg.sender and `to` addresses are not frozen.
262
+ * Require that the total value should not exceed available balance.
263
+ * Require that the `to` addresses are all verified addresses,
264
+ * IMPORTANT : THIS TRANSACTION COULD EXCEED GAS LIMIT IF `_toList.length` IS TOO HIGH,
265
+ * USE WITH CARE OR YOU COULD LOSE TX FEES WITH AN "OUT OF GAS" TRANSACTION
266
+ * @param _toList The addresses of the receivers
267
+ * @param _amounts The number of tokens to transfer to the corresponding receiver
268
+ * emits _toList.length `Transfer` events
269
+ */
270
+ function batchTransfer(address[] calldata _toList, uint256[] calldata _amounts) external;
271
+
272
+ /**
273
+ * @dev Initiates forced transfers in batch.
274
+ * Requires that each _amounts[i] does not exceed the available balance of _fromList[i].
275
+ * Requires that the _toList addresses are all verified and whitelisted addresses.
276
+ * IMPORTANT: THIS TRANSACTION COULD EXCEED GAS LIMIT IF _fromList.length IS TOO HIGH.
277
+ * USE WITH CARE TO AVOID "OUT OF GAS" TRANSACTIONS AND POTENTIAL LOSS OF TX FEES.
278
+ * @param _fromList The addresses of the senders.
279
+ * @param _toList The addresses of the receivers.
280
+ * @param _amounts The number of tokens to transfer to the corresponding receiver.
281
+ * This function can only be called by a wallet designated as an agent of the token,
282
+ * provided the agent is not restricted from initiating forced transfers in batch.
283
+ * Emits `TokensUnfrozen` events for each `_amounts[i]` that exceeds the free balance of `_fromList[i]`.
284
+ * Also emits _fromList.length `Transfer` events upon successful batch transfer.
285
+ * To execute this function, the calling agent must not be restricted from initiating forced transfer.
286
+ * If the agent is restricted from this capability, the function call will fail.
287
+ */
288
+ function batchForcedTransfer(address[] calldata _fromList, address[] calldata _toList, uint256[] calldata _amounts)
289
+ external;
290
+
291
+ /**
292
+ * @dev Initiates minting of tokens in batch.
293
+ * Requires that the `_toList` addresses are all verified and whitelisted addresses.
294
+ * IMPORTANT: THIS TRANSACTION COULD EXCEED GAS LIMIT IF `_toList.length` IS TOO HIGH.
295
+ * USE WITH CARE TO AVOID "OUT OF GAS" TRANSACTIONS AND POTENTIAL LOSS OF TX FEES.
296
+ * @param _toList The addresses of the receivers.
297
+ * @param _amounts The number of tokens to mint to the corresponding receiver.
298
+ * This function can only be called by a wallet designated as an agent of the token,
299
+ * provided the agent is not restricted from minting tokens.
300
+ * Emits _toList.length `Transfer` events upon successful batch minting.
301
+ * To execute this function, the calling agent must not be restricted from minting tokens.
302
+ * If the agent is restricted from this capability, the function call will fail.
303
+ */
304
+ function batchMint(address[] calldata _toList, uint256[] calldata _amounts) external;
305
+
306
+ /**
307
+ * @dev Initiates burning of tokens in batch.
308
+ * Requires that the `_userAddresses` addresses are all verified and whitelisted addresses.
309
+ * IMPORTANT: THIS TRANSACTION COULD EXCEED GAS LIMIT IF `_userAddresses.length` IS TOO HIGH.
310
+ * USE WITH CARE TO AVOID "OUT OF GAS" TRANSACTIONS AND POTENTIAL LOSS OF TX FEES.
311
+ * @param _userAddresses The addresses of the wallets concerned by the burn.
312
+ * @param _amounts The number of tokens to burn from the corresponding wallets.
313
+ * This function can only be called by a wallet designated as an agent of the token,
314
+ * provided the agent is not restricted from burning tokens.
315
+ * Emits _userAddresses.length `Transfer` events upon successful batch burn.
316
+ * To execute this function, the calling agent must not be restricted from burning tokens.
317
+ * If the agent is restricted from this capability, the function call will fail.
318
+ */
319
+ function batchBurn(address[] calldata _userAddresses, uint256[] calldata _amounts) external;
320
+
321
+ /**
322
+ * @dev Initiates setting of frozen status for addresses in batch.
323
+ * IMPORTANT: THIS TRANSACTION COULD EXCEED GAS LIMIT IF `_userAddresses.length` IS TOO HIGH.
324
+ * USE WITH CARE TO AVOID "OUT OF GAS" TRANSACTIONS AND POTENTIAL LOSS OF TX FEES.
325
+ * @param _userAddresses The addresses for which to update frozen status.
326
+ * @param _freeze Frozen status of the corresponding address.
327
+ * This function can only be called by a wallet designated as an agent of the token,
328
+ * provided the agent is not restricted from setting frozen addresses.
329
+ * Emits _userAddresses.length `AddressFrozen` events upon successful batch update of frozen status.
330
+ * To execute this function, the calling agent must not be restricted from setting frozen addresses.
331
+ * If the agent is restricted from this capability, the function call will fail.
332
+ */
333
+ function batchSetAddressFrozen(address[] calldata _userAddresses, bool[] calldata _freeze) external;
334
+
335
+ /**
336
+ * @dev Initiates partial freezing of tokens in batch.
337
+ * IMPORTANT: THIS TRANSACTION COULD EXCEED GAS LIMIT IF `_userAddresses.length` IS TOO HIGH.
338
+ * USE WITH CARE TO AVOID "OUT OF GAS" TRANSACTIONS AND POTENTIAL LOSS OF TX FEES.
339
+ * @param _userAddresses The addresses on which tokens need to be partially frozen.
340
+ * @param _amounts The amount of tokens to freeze on the corresponding address.
341
+ * This function can only be called by a wallet designated as an agent of the token,
342
+ * provided the agent is not restricted from partially freezing tokens.
343
+ * Emits _userAddresses.length `TokensFrozen` events upon successful batch partial freezing.
344
+ * To execute this function, the calling agent must not be restricted from partially freezing tokens.
345
+ * If the agent is restricted from this capability, the function call will fail.
346
+ */
347
+ function batchFreezePartialTokens(address[] calldata _userAddresses, uint256[] calldata _amounts) external;
348
+
349
+ /**
350
+ * @dev Initiates partial unfreezing of tokens in batch.
351
+ * IMPORTANT: THIS TRANSACTION COULD EXCEED GAS LIMIT IF `_userAddresses.length` IS TOO HIGH.
352
+ * USE WITH CARE TO AVOID "OUT OF GAS" TRANSACTIONS AND POTENTIAL LOSS OF TX FEES.
353
+ * @param _userAddresses The addresses on which tokens need to be partially unfrozen.
354
+ * @param _amounts The amount of tokens to unfreeze on the corresponding address.
355
+ * This function can only be called by a wallet designated as an agent of the token,
356
+ * provided the agent is not restricted from partially freezing tokens.
357
+ * Emits _userAddresses.length `TokensUnfrozen` events upon successful batch partial unfreezing.
358
+ * To execute this function, the calling agent must not be restricted from partially freezing tokens.
359
+ * If the agent is restricted from this capability, the function call will fail.
360
+ */
361
+ function batchUnfreezePartialTokens(address[] calldata _userAddresses, uint256[] calldata _amounts) external;
362
+
363
+ /// Getters
364
+
365
+ /**
366
+ * @dev Returns the address of the onchainID of the token.
367
+ * the onchainID of the token gives all the information available
368
+ * about the token and is managed by the token issuer or his agent.
369
+ */
370
+ function onchainID() external view returns (address);
371
+ /**
372
+ * @dev Returns the TREX version of the token.
373
+ */
374
+ function version() external view returns (string memory);
375
+
376
+ /**
377
+ * @dev Returns the Identity Registry linked to the token
378
+ */
379
+ function identityRegistry() external view returns (IERC3643IdentityRegistry);
380
+
381
+ /**
382
+ * @dev Returns the Compliance contract linked to the token
383
+ */
384
+ function compliance() external view returns (IERC3643Compliance);
385
+
386
+ /**
387
+ * @dev Returns true if the contract is paused, and false otherwise.
388
+ */
389
+ function paused() external view returns (bool);
390
+
391
+ /**
392
+ * @dev Returns the freezing status of a wallet
393
+ * if isFrozen returns `true` the wallet is frozen
394
+ * if isFrozen returns `false` the wallet is not frozen
395
+ * isFrozen returning `true` doesn't mean that the balance is free, tokens could be blocked by
396
+ * a partial freeze or the whole token could be blocked by pause
397
+ * @param _userAddress the address of the wallet on which isFrozen is called
398
+ */
399
+ function isFrozen(address _userAddress) external view returns (bool);
400
+
401
+ /**
402
+ * @dev Returns the amount of tokens that are partially frozen on a wallet
403
+ * the amount of frozen tokens is always <= to the total balance of the wallet
404
+ * @param _userAddress the address of the wallet on which getFrozenTokens is called
405
+ */
406
+ function getFrozenTokens(address _userAddress) external view returns (uint256);
407
+
408
+ }
@@ -0,0 +1,66 @@
1
+ // SPDX-License-Identifier: CC0-1.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
+ pragma solidity 0.8.30;
40
+
41
+ interface IERC3643ClaimTopicsRegistry {
42
+
43
+ /**
44
+ * @dev Add a trusted claim topic (For example: KYC=1, AML=2).
45
+ * Only owner can call.
46
+ * emits `ClaimTopicAdded` event
47
+ * cannot add more than 15 topics for 1 token as adding more could create gas issues
48
+ * @param _claimTopic The claim topic index
49
+ */
50
+ function addClaimTopic(uint256 _claimTopic) external;
51
+
52
+ /**
53
+ * @dev Remove a trusted claim topic (For example: KYC=1, AML=2).
54
+ * Only owner can call.
55
+ * emits `ClaimTopicRemoved` event
56
+ * @param _claimTopic The claim topic index
57
+ */
58
+ function removeClaimTopic(uint256 _claimTopic) external;
59
+
60
+ /**
61
+ * @dev Get the trusted claim topics for the security token
62
+ * @return Array of trusted claim topics
63
+ */
64
+ function getClaimTopics() external view returns (uint256[] memory);
65
+
66
+ }
@@ -0,0 +1,127 @@
1
+ // SPDX-License-Identifier: CC0-1.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
+ pragma solidity 0.8.30;
40
+
41
+ interface IERC3643Compliance {
42
+
43
+ /// Functions
44
+ /// initialization of the compliance contract
45
+ /**
46
+ * @dev binds a token to the compliance contract
47
+ * @param _token address of the token to bind
48
+ * This function can be called ONLY by the owner of the compliance contract
49
+ * Emits a TokenBound event
50
+ */
51
+ function bindToken(address _token) external;
52
+
53
+ /**
54
+ * @dev unbinds a token from the compliance contract
55
+ * @param _token address of the token to unbind
56
+ * This function can be called ONLY by the owner of the compliance contract
57
+ * Emits a TokenUnbound event
58
+ */
59
+ function unbindToken(address _token) external;
60
+
61
+ // compliance check and state update
62
+ /**
63
+ * @dev function called whenever tokens are transferred
64
+ * from one wallet to another
65
+ * this function can update state variables in the modules bound to the compliance
66
+ * these state variables being used by the module checks to decide if a transfer
67
+ * is compliant or not depending on the values stored in these state variables and on
68
+ * the parameters of the modules
69
+ * This function can be called ONLY by the token contract bound to the compliance
70
+ * @param _from The address of the sender
71
+ * @param _to The address of the receiver
72
+ * @param _amount The amount of tokens involved in the transfer
73
+ * This function calls moduleTransferAction() on each module bound to the compliance contract
74
+ */
75
+ function transferred(address _from, address _to, uint256 _amount) external;
76
+
77
+ /**
78
+ * @dev function called whenever tokens are created on a wallet
79
+ * this function can update state variables in the modules bound to the compliance
80
+ * these state variables being used by the module checks to decide if a transfer
81
+ * is compliant or not depending on the values stored in these state variables and on
82
+ * the parameters of the modules
83
+ * This function can be called ONLY by the token contract bound to the compliance
84
+ * @param _to The address of the receiver
85
+ * @param _amount The amount of tokens involved in the minting
86
+ * This function calls moduleMintAction() on each module bound to the compliance contract
87
+ */
88
+ function created(address _to, uint256 _amount) external;
89
+
90
+ /**
91
+ * @dev function called whenever tokens are destroyed from a wallet
92
+ * this function can update state variables in the modules bound to the compliance
93
+ * these state variables being used by the module checks to decide if a transfer
94
+ * is compliant or not depending on the values stored in these state variables and on
95
+ * the parameters of the modules
96
+ * This function can be called ONLY by the token contract bound to the compliance
97
+ * @param _from The address on which tokens are burnt
98
+ * @param _amount The amount of tokens involved in the burn
99
+ * This function calls moduleBurnAction() on each module bound to the compliance contract
100
+ */
101
+ function destroyed(address _from, uint256 _amount) external;
102
+
103
+ /**
104
+ * @dev checks that the transfer is compliant.
105
+ * default compliance always returns true
106
+ * READ ONLY FUNCTION, this function cannot be used to increment
107
+ * counters, emit events, ...
108
+ * @param _from The address of the sender
109
+ * @param _to The address of the receiver
110
+ * @param _amount The amount of tokens involved in the transfer
111
+ * This function will call moduleCheck() on every module bound to the compliance
112
+ * If each of the module checks return TRUE, this function will return TRUE as well
113
+ * returns FALSE otherwise
114
+ */
115
+ function canTransfer(address _from, address _to, uint256 _amount) external view returns (bool);
116
+
117
+ /// check the parameters of the compliance contract
118
+
119
+ function isTokenBound(address _token) external view returns (bool);
120
+
121
+ /**
122
+ * @dev getter for the address of the token bound
123
+ * returns the address of the token
124
+ */
125
+ function getTokenBound() external view returns (address);
126
+
127
+ }