@t-rex-network/t-rex 5.0.0-beta2 → 5.0.0-beta3
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/NOTICE.md +78 -0
- package/README.md +19 -22
- package/contracts/{roles/AgentRole.sol → ERC-3643/ERC3643ErrorsLib.sol} +60 -33
- package/contracts/ERC-3643/IERC3643.sol +61 -5
- package/contracts/ERC-3643/IERC3643ClaimTopicsRegistry.sol +11 -2
- package/contracts/ERC-3643/IERC3643Compliance.sol +21 -8
- package/contracts/ERC-3643/IERC3643IdentityRegistry.sol +33 -0
- package/contracts/ERC-3643/IERC3643IdentityRegistryStorage.sol +62 -7
- package/contracts/ERC-3643/IERC3643TrustedIssuersRegistry.sol +29 -12
- package/contracts/ERC-3643/base/ERC3643ClaimTopicsRegistry.sol +140 -0
- package/contracts/ERC-3643/base/ERC3643Compliance.sol +223 -0
- package/contracts/ERC-3643/base/ERC3643IdentityRegistry.sol +382 -0
- package/contracts/ERC-3643/base/ERC3643IdentityRegistryStorage.sol +290 -0
- package/contracts/ERC-3643/base/ERC3643Token.sol +601 -0
- package/contracts/ERC-3643/base/ERC3643TrustedIssuersRegistry.sol +237 -0
- package/contracts/compliance/modular/ComplianceLedger.sol +175 -0
- package/contracts/compliance/modular/ComplianceLedgerLib.sol +120 -0
- package/contracts/compliance/modular/IComplianceLedger.sol +104 -0
- package/contracts/compliance/modular/IModularCompliance.sol +119 -28
- package/contracts/compliance/modular/ITransferValidation.sol +308 -0
- package/contracts/compliance/modular/ModularCompliance.sol +399 -240
- package/contracts/compliance/modular/ModuleSetLib.sol +182 -0
- package/contracts/compliance/modular/MovementKindLib.sol +97 -0
- package/contracts/compliance/modular/TransferContextLib.sol +140 -0
- package/contracts/compliance/modular/TransferValidation.sol +822 -0
- package/contracts/compliance/modular/TransferValidationLib.sol +183 -0
- package/contracts/compliance/modular/modules/AbstractModuleUpgradeable.sol +87 -56
- package/contracts/compliance/modular/modules/IModule.sol +142 -58
- package/contracts/compliance/modular/modules/MaxBalancePerIdentityModule.sol +175 -0
- package/contracts/compliance/modular/modules/ModuleProxy.sol +24 -24
- package/contracts/compliance/modular/modules/SpenderVerificationModule.sol +149 -0
- package/contracts/compliance/modular/modules/SpenderWhitelistModule.sol +215 -0
- package/contracts/factory/ITREXFactory.sol +94 -44
- package/contracts/factory/TREXFactory.sol +408 -201
- package/contracts/interop/ISettlementHandler.sol +101 -0
- package/contracts/interop/ITREXMessaging.sol +166 -0
- package/contracts/{proxy/ModularComplianceProxy.sol → interop/ITrustedGatewayRegistry.sol} +48 -43
- package/contracts/interop/TREXMessaging.sol +189 -0
- package/contracts/interop/TREXMessagingLib.sol +425 -0
- package/contracts/{proxy/TrustedIssuersRegistryProxy.sol → interop/TrustedGatewayRegistry.sol} +46 -37
- package/contracts/libraries/AccessManagerSetupLib.sol +484 -0
- package/contracts/libraries/ErrorsLib.sol +172 -65
- package/contracts/libraries/EventsLib.sol +168 -66
- package/contracts/libraries/MessageTypesLib.sol +259 -0
- package/contracts/libraries/RolesLib.sol +146 -0
- package/contracts/{roles/Roles.sol → libraries/VersionLib.sol} +46 -49
- package/contracts/libraries/WalletKeyLib.sol +156 -0
- package/contracts/proxy/beacon/ITREXImplementationAuthority.sol +157 -0
- package/contracts/proxy/beacon/TREXImplementationAuthority.sol +188 -0
- package/contracts/registry/implementation/IdentityRegistryStorage.sol +215 -163
- package/contracts/registry/implementation/TREXRegistry.sol +475 -0
- package/contracts/registry/interface/IIdentityRegistryStorage.sol +30 -25
- package/contracts/registry/interface/ITREXRegistry.sol +180 -0
- package/contracts/token/IToken.sol +210 -49
- package/contracts/token/Token.sol +411 -476
- package/contracts/token/TokenDelegationLib.sol +339 -0
- package/contracts/token/TokenGuardsLib.sol +123 -0
- package/contracts/token/TokenLedgerLib.sol +316 -0
- package/contracts/token/TokenRecoveryLib.sol +130 -0
- package/contracts/{roles/AgentRoleUpgradeable.sol → utils/AccessManagedOwnable.sol} +31 -31
- package/contracts/{proxy/IdentityRegistryStorageProxy.sol → utils/AccessManagedOwnableBase.sol} +56 -34
- package/contracts/utils/AccessManagedOwnableUpgradeable.sol +116 -0
- package/contracts/utils/IUtilityChecker.sol +32 -26
- package/contracts/{roles/AbstractAgentRole.sol → utils/TREXAccessManager.sol} +54 -57
- package/contracts/utils/UtilityChecker.sol +175 -52
- package/contracts/utils/UtilityCheckerProxy.sol +24 -24
- package/contracts/{proxy/interface/IProxy.sol → vendor/IERC173.sol} +15 -28
- package/out/AbstractModuleUpgradeable.sol/AbstractModuleUpgradeable.json +1 -1
- package/out/AbstractSigner.sol/AbstractSigner.json +1 -0
- package/out/AccessManaged.sol/AccessManaged.json +1 -0
- package/out/AccessManagedOwnable.sol/AccessManagedOwnable.json +1 -0
- package/out/AccessManagedOwnableBase.sol/AccessManagedOwnableBase.json +1 -0
- package/out/AccessManagedOwnableUpgradeable.sol/AccessManagedOwnableUpgradeable.json +1 -0
- package/out/AccessManagedUpgradeable.sol/AccessManagedUpgradeable.json +1 -0
- package/out/AccessManager.sol/AccessManager.json +1 -0
- package/out/AccessManagerHelper.sol/AccessManagerHelper.json +1 -0
- package/out/AccessManagerSetupLib.sol/AccessManagerSetupLib.json +1 -0
- package/out/AccessManagerUpgradeable.sol/AccessManagerUpgradeable.json +1 -0
- package/out/Account.sol/Account.json +1 -0
- package/out/Address.sol/Address.json +1 -1
- package/out/Arrays.sol/Arrays.json +1 -1
- package/out/AuthorityUtils.sol/AuthorityUtils.json +1 -0
- package/out/Base.sol/CommonBase.json +1 -1
- package/out/Base.sol/ScriptBase.json +1 -1
- package/out/Base.sol/TestBase.json +1 -1
- package/out/Base64.sol/Base64.json +1 -0
- package/out/BeaconProxy.sol/BeaconProxy.json +1 -0
- package/out/BeaconProxyDeployer.sol/BeaconProxyDeployer.json +1 -0
- package/out/Bytes.sol/Bytes.json +1 -1
- package/out/Calldata.sol/Calldata.json +1 -0
- package/out/CapabilityModules.sol/AllTypesModule.json +1 -0
- package/out/CapabilityModules.sol/CappedRecipientModule.json +1 -0
- package/out/CapabilityModules.sol/DelegatedCapRuleModule.json +1 -0
- package/out/CapabilityModules.sol/DuplicateTypeModule.json +1 -0
- package/out/CapabilityModules.sol/LockedSenderModule.json +1 -0
- package/out/CapabilityModules.sol/NoTypeModule.json +1 -0
- package/out/CapabilityModules.sol/RecordingModule.json +1 -0
- package/out/CapabilityModules.sol/RuleAndMintTrackerModule.json +1 -0
- package/out/CapabilityModules.sol/RuleAndTrackerModule.json +1 -0
- package/out/CapabilityModules.sol/RuleOnlyModule.json +1 -0
- package/out/CapabilityModules.sol/SpenderOnlyModule.json +1 -0
- package/out/CapabilityModules.sol/TrackerOnlyModule.json +1 -0
- package/out/CapabilityModules.sol/UndeclaredRuleModule.json +1 -0
- package/out/CapabilityModules.sol/WritingRuleModule.json +1 -0
- package/out/ClaimIssuerAlwaysReverts.sol/ClaimIssuerAlwaysReverts.json +1 -0
- package/out/ClaimIssuerTrick.sol/ClaimIssuerTrick.json +1 -1
- package/out/Comparators.sol/Comparators.json +1 -1
- package/out/ComplianceLedger.sol/ComplianceLedger.json +1 -0
- package/out/ComplianceLedgerLib.sol/ComplianceLedgerLib.json +1 -0
- package/out/Context.sol/Context.json +1 -1
- package/out/ContextUpgradeable.sol/ContextUpgradeable.json +1 -1
- package/out/Countries.sol/Countries.json +1 -1
- package/out/Create2.sol/Create2.json +1 -1
- package/out/Create3.sol/Create3.json +1 -1
- package/out/DeployComplianceModules.s.sol/DeployComplianceModules.json +1 -0
- package/out/DeployComplianceModules.s.sol/ITokenCompliance.json +1 -0
- package/out/DeployUtilityChecker.s.sol/DeployUtilityChecker.json +1 -0
- package/out/ECDSA.sol/ECDSA.json +1 -1
- package/out/EIP712.sol/EIP712.json +1 -1
- package/out/EIP712Upgradeable.sol/EIP712Upgradeable.json +1 -1
- package/out/ERC165.sol/ERC165.json +1 -0
- package/out/ERC165Checker.sol/ERC165Checker.json +1 -0
- package/out/ERC165Upgradeable.sol/ERC165Upgradeable.json +1 -0
- package/out/ERC1967Proxy.sol/ERC1967Proxy.json +1 -1
- package/out/ERC1967Utils.sol/ERC1967Utils.json +1 -1
- package/out/ERC20.sol/ERC20.json +1 -1
- package/out/ERC20Pausable.sol/ERC20Pausable.json +1 -1
- package/out/ERC20PermitUpgradeable.sol/ERC20PermitUpgradeable.json +1 -1
- package/out/ERC20Upgradeable.sol/ERC20Upgradeable.json +1 -1
- package/out/ERC3643ClaimTopicsRegistry.sol/ERC3643ClaimTopicsRegistry.json +1 -0
- package/out/ERC3643Compliance.sol/ERC3643Compliance.json +1 -0
- package/out/ERC3643ErrorsLib.sol/ERC3643ErrorsLib.json +1 -0
- package/out/ERC3643IdentityRegistry.sol/ERC3643IdentityRegistry.json +1 -0
- package/out/ERC3643IdentityRegistryStorage.sol/ERC3643IdentityRegistryStorage.json +1 -0
- package/out/ERC3643Token.sol/ERC3643Token.json +1 -0
- package/out/ERC3643TrustedIssuersRegistry.sol/ERC3643TrustedIssuersRegistry.json +1 -0
- package/out/ERC4337Utils.sol/ERC4337Utils.json +1 -0
- package/out/ERC4337Utils.sol/IEntryPointExtra.json +1 -0
- package/out/ERC734Validator.sol/ERC734Validator.json +1 -0
- package/out/ERC7579Validator.sol/ERC7579Validator.json +1 -0
- package/out/ERC7786GatewayMock.sol/ERC7786GatewayMock.json +1 -0
- package/out/ERC7786Recipient.sol/ERC7786Recipient.json +1 -0
- package/out/ERC7913WebAuthnVerifier.sol/ERC7913WebAuthnVerifier.json +1 -0
- package/out/EnumerableSet.sol/EnumerableSet.json +1 -1
- package/out/Errors.sol/Errors.json +1 -1
- package/out/ErrorsLib.sol/ErrorsLib.json +1 -1
- package/out/EventsLib.sol/EventsLib.json +1 -1
- package/out/Hashes.sol/Hashes.json +1 -0
- package/out/HostileModules.sol/RevertEverywhereModule.json +1 -0
- package/out/HostileModules.sol/UnbindRevertingModule.json +1 -0
- package/out/IAccessManaged.sol/IAccessManaged.json +1 -0
- package/out/IAccessManager.sol/IAccessManager.json +1 -0
- package/out/IAuthority.sol/IAuthority.json +1 -0
- package/out/IBeacon.sol/IBeacon.json +1 -1
- package/out/IClaimIssuer.sol/IClaimIssuer.json +1 -1
- package/out/IComplianceLedger.sol/IComplianceLedger.json +1 -0
- package/out/IERC1271.sol/IERC1271.json +1 -0
- package/out/IERC165.sol/IERC165.json +1 -1
- package/out/IERC173.sol/IERC173.json +1 -1
- package/out/IERC1967.sol/IERC1967.json +1 -1
- package/out/IERC20.sol/IERC20.json +1 -1
- package/out/IERC20Metadata.sol/IERC20Metadata.json +1 -1
- package/out/IERC20Permit.sol/IERC20Permit.json +1 -1
- package/out/IERC3643.sol/IERC3643.json +1 -1
- package/out/IERC3643ClaimTopicsRegistry.sol/IERC3643ClaimTopicsRegistry.json +1 -1
- package/out/IERC3643Compliance.sol/IERC3643Compliance.json +1 -1
- package/out/IERC3643IdentityRegistry.sol/IERC3643IdentityRegistry.json +1 -1
- package/out/IERC3643IdentityRegistryStorage.sol/IERC3643IdentityRegistryStorage.json +1 -1
- package/out/IERC3643TrustedIssuersRegistry.sol/IERC3643TrustedIssuersRegistry.json +1 -1
- package/out/IERC4337.sol/IAccount.json +1 -0
- package/out/IERC4337.sol/IAccountExecute.json +1 -0
- package/out/IERC4337.sol/IAggregator.json +1 -0
- package/out/IERC4337.sol/IEntryPoint.json +1 -0
- package/out/IERC4337.sol/IEntryPointNonces.json +1 -0
- package/out/IERC4337.sol/IEntryPointStake.json +1 -0
- package/out/IERC4337.sol/IPaymaster.json +1 -0
- package/out/IERC5267.sol/IERC5267.json +1 -1
- package/out/IERC734.sol/IERC734.json +1 -1
- package/out/IERC735.sol/IERC735.json +1 -1
- package/out/IERC7913.sol/IERC7913SignatureVerifier.json +1 -0
- package/out/IIdentity.sol/IIdentity.json +1 -1
- package/out/IIdentityFactory.sol/IIdentityFactory.json +1 -0
- package/out/IIdentityRegistryStorage.sol/IIdentityRegistryStorage.json +1 -1
- package/out/IKeyExecutor.sol/IKeyExecutor.json +1 -0
- package/out/IModularCompliance.sol/IModularCompliance.json +1 -1
- package/out/IModule.sol/IModule.json +1 -1
- package/out/IMulticall3.sol/IMulticall3.json +1 -1
- package/out/IReputationRegistry.sol/IReputationRegistry.json +1 -0
- package/out/ISettlementHandler.sol/ISettlementHandler.json +1 -0
- package/out/ITREXFactory.sol/ITREXFactory.json +1 -1
- package/out/ITREXImplementationAuthority.sol/ITREXImplementationAuthority.json +1 -1
- package/out/ITREXMessaging.sol/ITREXMessaging.json +1 -0
- package/out/ITREXRegistry.sol/ITREXRegistry.json +1 -0
- package/out/IToken.sol/IToken.json +1 -1
- package/out/ITransferValidation.sol/ITransferValidation.json +1 -0
- package/out/ITrustedGatewayRegistry.sol/ITrustedGatewayRegistry.json +1 -0
- package/out/IUtilityChecker.sol/IUtilityChecker.json +1 -1
- package/out/Identity.sol/Identity.json +1 -1
- package/out/IdentityFactory.sol/IdentityFactory.json +1 -0
- package/out/IdentityModulesHelper.sol/IdentityModulesHelper.json +1 -0
- package/out/IdentityRegistryStorage.sol/IdentityRegistryStorage.json +1 -1
- package/out/IdentityTypes.sol/IdentityTypes.json +1 -0
- package/out/Initializable.sol/Initializable.json +1 -1
- package/out/InteropSuiteTest.sol/InteropSuiteTest.json +1 -0
- package/out/KeyApprovalModule.sol/IIdentityAccount.json +1 -0
- package/out/KeyApprovalModule.sol/KeyApprovalModule.json +1 -0
- package/out/KeyManager.sol/KeyManager.json +1 -0
- package/out/KeyPurposes.sol/KeyPurposes.json +1 -1
- package/out/KeyTypes.sol/KeyTypes.json +1 -1
- package/out/LowLevelCall.sol/LowLevelCall.json +1 -1
- package/out/Math.sol/Math.json +1 -1
- package/out/MaxBalancePerIdentityModule.sol/MaxBalancePerIdentityModule.json +1 -0
- package/out/MessageHashUtils.sol/MessageHashUtils.json +1 -1
- package/out/MessageTypesLib.sol/MessageTypesLib.json +1 -0
- package/out/MockTREXAccessManagerV2.sol/MockTREXAccessManagerV2.json +1 -0
- package/out/MockTokenV2.sol/MockTokenV2.json +1 -0
- package/out/Mocks.sol/ClaimTopicsRegistryMock.json +1 -0
- package/out/Mocks.sol/ComplianceMock.json +1 -0
- package/out/Mocks.sol/IdentityRegistryMock.json +1 -0
- package/out/Mocks.sol/IdentityRegistryStorageMock.json +1 -0
- package/out/Mocks.sol/TokenMock.json +1 -0
- package/out/Mocks.sol/TrustedIssuersRegistryMock.json +1 -0
- package/out/ModularCompliance.sol/ModularCompliance.json +1 -1
- package/out/ModuleNotPnP.sol/ModuleNotPnP.json +1 -1
- package/out/ModuleProxy.sol/ModuleProxy.json +1 -1
- package/out/ModuleSetLib.sol/ModuleSetLib.json +1 -0
- package/out/MovementKindLib.sol/MovementKindLib.json +1 -0
- package/out/Multicall.sol/Multicall.json +1 -0
- package/out/MulticallUpgradeable.sol/MulticallUpgradeable.json +1 -1
- package/out/Nonces.sol/Nonces.json +1 -1
- package/out/NoncesUpgradeable.sol/NoncesUpgradeable.json +1 -1
- package/out/Ownable.sol/Ownable.json +1 -1
- package/out/OwnableUpgradeable.sol/OwnableUpgradeable.json +1 -1
- package/out/P256.sol/P256.json +1 -0
- package/out/Packing.sol/Packing.json +1 -0
- package/out/Panic.sol/Panic.json +1 -1
- package/out/Pausable.sol/Pausable.json +1 -1
- package/out/PausableUpgradeable.sol/PausableUpgradeable.json +1 -1
- package/out/Proxy.sol/Proxy.json +1 -1
- package/out/ReentrancyGuardTransient.sol/ReentrancyGuardTransient.json +1 -0
- package/out/ReentrantModule.sol/ReentrantModule.json +1 -0
- package/out/ReputationRegistry.sol/ReputationRegistry.json +1 -0
- package/out/RolesLib.sol/RolesLib.json +1 -0
- package/out/SafeCalldataBatch.sol/SafeCalldataBatch.json +1 -0
- package/out/SafeCast.sol/SafeCast.json +1 -1
- package/out/SatelliteLiteMock.sol/SatelliteLiteMock.json +1 -0
- package/out/Script.sol/Script.json +1 -0
- package/out/ShortStrings.sol/ShortStrings.json +1 -1
- package/out/SignatureChecker.sol/SignatureChecker.json +1 -0
- package/out/SignedMath.sol/SignedMath.json +1 -1
- package/out/SlotDerivation.sol/SlotDerivation.json +1 -1
- package/out/SmartAccount.sol/SmartAccount.json +1 -0
- package/out/SpenderVerificationModule.sol/SpenderVerificationModule.json +1 -0
- package/out/SpenderWhitelistModule.sol/SpenderWhitelistModule.json +1 -0
- package/out/StdAssertions.sol/StdAssertions.json +1 -1
- package/out/StdChains.sol/StdChains.json +1 -1
- package/out/StdCheats.sol/StdCheats.json +1 -1
- package/out/StdCheats.sol/StdCheatsSafe.json +1 -1
- package/out/StdConstants.sol/StdConstants.json +1 -1
- package/out/StdError.sol/stdError.json +1 -1
- package/out/StdInvariant.sol/StdInvariant.json +1 -1
- package/out/StdJson.sol/stdJson.json +1 -1
- package/out/StdMath.sol/stdMath.json +1 -1
- package/out/StdStorage.sol/stdStorage.json +1 -1
- package/out/StdStorage.sol/stdStorageSafe.json +1 -1
- package/out/StdStyle.sol/StdStyle.json +1 -1
- package/out/StdToml.sol/stdToml.json +1 -1
- package/out/StdUtils.sol/StdUtils.json +1 -1
- package/out/StorageSlot.sol/StorageSlot.json +1 -1
- package/out/Strings.sol/Strings.json +1 -1
- package/out/Structs.sol/Structs.json +1 -1
- package/out/TREXAccessManager.sol/TREXAccessManager.json +1 -0
- package/out/TREXFactory.sol/TREXFactory.json +1 -1
- package/out/TREXImplementationAuthority.sol/TREXImplementationAuthority.json +1 -1
- package/out/TREXMessaging.sol/TREXMessaging.json +1 -0
- package/out/TREXMessagingLib.sol/TREXMessagingLib.json +1 -0
- package/out/TREXRegistry.sol/TREXRegistry.json +1 -0
- package/out/TestERC20.sol/TestERC20.json +1 -1
- package/out/TestModule.sol/TestModule.json +1 -1
- package/out/TestTREXFactory.sol/TestTREXFactory.json +1 -1
- package/out/Time.sol/Time.json +1 -0
- package/out/Token.sol/Token.json +1 -1
- package/out/TokenDelegationLib.sol/TokenDelegationLib.json +1 -0
- package/out/TokenGuardsLib.sol/TokenGuardsLib.json +1 -0
- package/out/TokenHandler.sol/TokenHandler.json +1 -0
- package/out/TokenLedgerHarness.sol/TokenLedgerHarness.json +1 -0
- package/out/TokenLedgerLib.sol/TokenLedgerLib.json +1 -0
- package/out/TokenRecoveryLib.sol/TokenRecoveryLib.json +1 -0
- package/out/TokenReservationStub.sol/TokenReservationStub.json +1 -0
- package/out/TransferContextLib.sol/TransferContextLib.json +1 -0
- package/out/TransferValidation.sol/TransferValidation.json +1 -0
- package/out/TransferValidationHarness.sol/TransferValidationHarness.json +1 -0
- package/out/TransferValidationLib.sol/TransferValidationLib.json +1 -0
- package/out/TransientSlot.sol/TransientSlot.json +1 -0
- package/out/TrustedGatewayRegistry.sol/TrustedGatewayRegistry.json +1 -0
- package/out/UUPSUpgradeable.sol/UUPSUpgradeable.json +1 -1
- package/out/UpgradeableBeacon.sol/UpgradeableBeacon.json +1 -0
- package/out/UtilityChecker.sol/UtilityChecker.json +1 -1
- package/out/UtilityCheckerProxy.sol/UtilityCheckerProxy.json +1 -1
- package/out/Utils.sol/Utils.json +1 -1
- package/out/VersionLib.sol/VersionLib.json +1 -0
- package/out/Vm.sol/Vm.json +1 -1
- package/out/Vm.sol/VmSafe.json +1 -1
- package/out/WalletKeyLib.sol/WalletKeyLib.json +1 -0
- package/out/WebAuthn.sol/WebAuthn.json +1 -0
- package/out/console.sol/console.json +1 -1
- package/out/draft-AccountERC7579Upgradeable.sol/AccountERC7579Upgradeable.json +1 -0
- package/out/draft-ERC7579Utils.sol/ERC7579Utils.json +1 -0
- package/out/draft-IERC1822.sol/IERC1822Proxiable.json +1 -1
- package/out/draft-IERC6093.sol/IERC1155Errors.json +1 -1
- package/out/draft-IERC6093.sol/IERC20Errors.json +1 -1
- package/out/draft-IERC6093.sol/IERC721Errors.json +1 -1
- package/out/draft-IERC7579.sol/IERC7579AccountConfig.json +1 -0
- package/out/draft-IERC7579.sol/IERC7579Execution.json +1 -0
- package/out/draft-IERC7579.sol/IERC7579Hook.json +1 -0
- package/out/draft-IERC7579.sol/IERC7579Module.json +1 -0
- package/out/draft-IERC7579.sol/IERC7579ModuleConfig.json +1 -0
- package/out/draft-IERC7579.sol/IERC7579Validator.json +1 -0
- package/out/draft-IERC7786.sol/IERC7786GatewaySource.json +1 -0
- package/out/draft-IERC7786.sol/IERC7786Recipient.json +1 -0
- package/out/draft-InteroperableAddress.sol/InteroperableAddress.json +1 -0
- package/out/libraries/Errors.sol/Errors.json +1 -1
- package/out/safeconsole.sol/safeconsole.json +1 -1
- package/package.json +11 -7
- package/contracts/ERC-3643/ERC3643EventsLib.sol +0 -150
- package/contracts/factory/ITREXGateway.sol +0 -234
- package/contracts/factory/TREXGateway.sol +0 -274
- package/contracts/proxy/AbstractProxy.sol +0 -146
- package/contracts/proxy/ClaimTopicsRegistryProxy.sol +0 -83
- package/contracts/proxy/IdentityRegistryProxy.sol +0 -95
- package/contracts/proxy/TokenProxy.sol +0 -97
- package/contracts/proxy/authority/IAFactory.sol +0 -122
- package/contracts/proxy/authority/IIAFactory.sol +0 -87
- package/contracts/proxy/authority/ITREXImplementationAuthority.sol +0 -239
- package/contracts/proxy/authority/TREXImplementationAuthority.sol +0 -350
- package/contracts/registry/implementation/ClaimTopicsRegistry.sol +0 -152
- package/contracts/registry/implementation/IdentityRegistry.sol +0 -352
- package/contracts/registry/implementation/TrustedIssuersRegistry.sol +0 -272
- package/contracts/registry/interface/IClaimTopicsRegistry.sol +0 -70
- package/contracts/registry/interface/IIdentityRegistry.sol +0 -102
- package/contracts/registry/interface/ITrustedIssuersRegistry.sol +0 -70
- package/contracts/roles/IERC173.sol +0 -21
- package/contracts/token/TokenStructs.sol +0 -74
- package/contracts/utils/InterfaceIdCalculator.sol +0 -223
- package/contracts/vendor/openzeppelin/Create3.sol +0 -143
- package/out/AbstractAgentRole.sol/AbstractAgentRole.json +0 -1
- package/out/AbstractProxy.sol/AbstractProxy.json +0 -1
- package/out/AgentRole.sol/AgentRole.json +0 -1
- package/out/AgentRoleUpgradeable.sol/AgentRoleUpgradeable.json +0 -1
- package/out/ClaimIssuer.sol/ClaimIssuer.json +0 -1
- package/out/ClaimTopicsRegistry.sol/ClaimTopicsRegistry.json +0 -1
- package/out/ClaimTopicsRegistryProxy.sol/ClaimTopicsRegistryProxy.json +0 -1
- package/out/ERC2771Context.sol/ERC2771Context.json +0 -1
- package/out/ERC2771ContextUpgradeable.sol/ERC2771ContextUpgradeable.json +0 -1
- package/out/ERC2771Forwarder.sol/ERC2771Forwarder.json +0 -1
- package/out/ERC3643EventsLib.sol/ERC3643EventsLib.json +0 -1
- package/out/IAFactory.sol/IAFactory.json +0 -1
- package/out/IClaimTopicsRegistry.sol/IClaimTopicsRegistry.json +0 -1
- package/out/IERC1363.sol/IERC1363.json +0 -1
- package/out/IIAFactory.sol/IIAFactory.json +0 -1
- package/out/IIdFactory.sol/IIdFactory.json +0 -1
- package/out/IIdentityRegistry.sol/IIdentityRegistry.json +0 -1
- package/out/IImplementationAuthority.sol/IImplementationAuthority.json +0 -1
- package/out/IProxy.sol/IProxy.json +0 -1
- package/out/ITREXGateway.sol/ITREXGateway.json +0 -1
- package/out/ITrustedIssuersRegistry.sol/ITrustedIssuersRegistry.json +0 -1
- package/out/IdFactory.sol/IdFactory.json +0 -1
- package/out/IdentityProxy.sol/IdentityProxy.json +0 -1
- package/out/IdentityRegistry.sol/IdentityRegistry.json +0 -1
- package/out/IdentityRegistryProxy.sol/IdentityRegistryProxy.json +0 -1
- package/out/IdentityRegistryStorageProxy.sol/IdentityRegistryStorageProxy.json +0 -1
- package/out/ImplementationAuthority.sol/ImplementationAuthority.json +0 -1
- package/out/InterfaceIdCalculator.sol/InterfaceIdCalculator.json +0 -1
- package/out/ModularComplianceProxy.sol/ModularComplianceProxy.json +0 -1
- package/out/Ownable2Step.sol/Ownable2Step.json +0 -1
- package/out/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.json +0 -1
- package/out/Roles.sol/Roles.json +0 -1
- package/out/SafeERC20.sol/SafeERC20.json +0 -1
- package/out/Storage.sol/Storage.json +0 -1
- package/out/TREXGateway.sol/TREXGateway.json +0 -1
- package/out/TestAgentRole.sol/TestAgentRole.json +0 -1
- package/out/TestAgentRoleUpgradeable.sol/TestAgentRoleUpgradeable.json +0 -1
- package/out/TokenProxy.sol/TokenProxy.json +0 -1
- package/out/TrustedIssuersRegistry.sol/TrustedIssuersRegistry.json +0 -1
- package/out/TrustedIssuersRegistryProxy.sol/TrustedIssuersRegistryProxy.json +0 -1
- package/out/Version.sol/Version.json +0 -1
package/NOTICE.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# NOTICE
|
|
2
|
+
|
|
3
|
+
## T-REX Smart Contracts
|
|
4
|
+
|
|
5
|
+
Copyright (C) 2026 Digital Asset Operational Services ISAC Ltd. ("T-REX Network")
|
|
6
|
+
|
|
7
|
+
T-REX is the open-source token suite of the T-REX ecosystem for compliant
|
|
8
|
+
tokenized assets. It implements the ERC-3643 standard: a permissioned token
|
|
9
|
+
whose holders are verified through ONCHAINID identities and whose transfers
|
|
10
|
+
are checked by a modular compliance contract, with a factory, a version
|
|
11
|
+
registry and cross-chain messaging around it.
|
|
12
|
+
|
|
13
|
+
Website: https://www.t-rex.network
|
|
14
|
+
Contact: legal@t-rex.network
|
|
15
|
+
|
|
16
|
+
## License
|
|
17
|
+
|
|
18
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
19
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
20
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
21
|
+
version.
|
|
22
|
+
|
|
23
|
+
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
24
|
+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
25
|
+
FOR A PARTICULAR PURPOSE. See the GNU General Public License in
|
|
26
|
+
[LICENSE.md](./LICENSE.md) for more details.
|
|
27
|
+
|
|
28
|
+
You should have received a copy of the GNU General Public License along with
|
|
29
|
+
this program. If not, see <https://www.gnu.org/licenses/>.
|
|
30
|
+
|
|
31
|
+
## Provenance and modifications
|
|
32
|
+
|
|
33
|
+
This repository originated as a fork of the T-REX reference implementation of
|
|
34
|
+
ERC-3643 published by Tokeny sàrl (https://github.com/TokenySolutions/T-REX),
|
|
35
|
+
released under the GNU General Public License v3.0. The `main` branch of this
|
|
36
|
+
repository holds the T-REX v4 line inherited from upstream.
|
|
37
|
+
|
|
38
|
+
The codebase has since been substantially rewritten and re-architected by and
|
|
39
|
+
for Digital Asset Operational Services ISAC Ltd. The current implementation
|
|
40
|
+
splits the ERC-3643 standard surface into base contracts over ERC-7201
|
|
41
|
+
namespaces, merges the eligibility registries into one T-REX registry, moves
|
|
42
|
+
access control to the OpenZeppelin AccessManager, replaces the proxy layer
|
|
43
|
+
with beacons and a version registry, adds a typed compliance ledger with
|
|
44
|
+
transfer validation, and adds ERC-7786 cross-chain messaging. It differs
|
|
45
|
+
materially from the original implementation in architecture, storage layout,
|
|
46
|
+
access model, compliance model and deployment model. These modifications were
|
|
47
|
+
made in 2025 and 2026. This statement constitutes the notice of modification
|
|
48
|
+
required by Section 5(a) of the GNU General Public License v3.
|
|
49
|
+
|
|
50
|
+
Copyright in any code originating from the upstream repository remains with
|
|
51
|
+
Tokeny sàrl and continues to be licensed under the GPL-3.0. Files that still
|
|
52
|
+
derive from the upstream code carry the line "Copyright (C) 2023, Tokeny sàrl."
|
|
53
|
+
in their header, next to the T-REX Network copyright line. Copyright in all
|
|
54
|
+
new and modified code in this repository is held by Digital Asset Operational
|
|
55
|
+
Services ISAC Ltd.
|
|
56
|
+
|
|
57
|
+
## Trademarks
|
|
58
|
+
|
|
59
|
+
"T-REX Network" is the trade name of Digital Asset Operational Services
|
|
60
|
+
ISAC Ltd. The GNU General Public License grants rights in the software only.
|
|
61
|
+
It does not grant permission to use any trade names, trademarks, service
|
|
62
|
+
marks, or logos appearing in this repository or associated with the T-REX
|
|
63
|
+
ecosystem, including "T-REX", "T-REX Network" and "ONCHAINID", except for
|
|
64
|
+
reasonable and customary use in describing the origin of the work. All
|
|
65
|
+
trademarks are the property of their respective owners. Use of the software
|
|
66
|
+
under the GPL-3.0 does not imply any endorsement by, or affiliation with,
|
|
67
|
+
Digital Asset Operational Services ISAC Ltd. or any other rights holder.
|
|
68
|
+
|
|
69
|
+
## Third-party components
|
|
70
|
+
|
|
71
|
+
This software depends on third-party components, including OpenZeppelin
|
|
72
|
+
Contracts and OpenZeppelin Contracts Upgradeable (MIT License), and on the
|
|
73
|
+
ONCHAINID contracts (GPL-3.0), also published by Digital Asset Operational
|
|
74
|
+
Services ISAC Ltd. The six `IERC3643*.sol` interface files directly under
|
|
75
|
+
`contracts/ERC-3643` are published under CC0-1.0, and
|
|
76
|
+
`contracts/vendor/IERC173.sol` under the MIT License. Third-party components
|
|
77
|
+
remain subject to their own license terms, which are unaffected by this
|
|
78
|
+
NOTICE.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|

|
|
5
|
-
](https://img.shields.io/github/actions/workflow/status/T-REX-Network/T-REX/test.yml?branch=develop)
|
|
6
6
|

|
|
7
7
|

|
|
8
8
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<br><br>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
|
-
<a href="
|
|
14
|
+
<a href="./docs/TREX-WhitePaper.pdf">
|
|
15
15
|
<img src="./docs/img/T-REX.png" width="150" title="t-rex">
|
|
16
16
|
</a>
|
|
17
17
|
</p>
|
|
@@ -78,20 +78,18 @@ forge test --gas-report # Run tests with gas report
|
|
|
78
78
|
|
|
79
79
|
### Coverage
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
bash ./generate_coverage.sh
|
|
85
|
-
|
|
81
|
+
```bash
|
|
82
|
+
npm run coverage # terminal summary
|
|
83
|
+
npm run coverage:report # LCOV + HTML report, then opens it
|
|
86
84
|
```
|
|
87
85
|
|
|
88
|
-
|
|
86
|
+
`npm run coverage` prints a terminal summary with coverage percentages. Tests, dependencies,
|
|
87
|
+
scripts and vendored code are excluded from the report.
|
|
89
88
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
- HTML report (`coverage/lcov-report/index.html`) for interactive viewing
|
|
89
|
+
`npm run coverage:report` additionally writes an LCOV report to `coverage/lcov.info` for CI/CD
|
|
90
|
+
integration and an HTML report to `coverage/report/index.html` for interactive viewing.
|
|
93
91
|
|
|
94
|
-
**Note:**
|
|
92
|
+
**Note:** The HTML report needs `lcov` installed:
|
|
95
93
|
|
|
96
94
|
```bash
|
|
97
95
|
brew install lcov # macOS
|
|
@@ -116,22 +114,21 @@ forge flatten <contract-path> # Flatten a contract
|
|
|
116
114
|
## Documentation
|
|
117
115
|
|
|
118
116
|
For a detailed understanding of the T-REX protocol, please refer to the [whitepaper](./docs/TREX-WhitePaper.pdf).
|
|
119
|
-
All functions of T-REX smart contracts are described in the [T-REX documentation](https://docs.
|
|
117
|
+
All functions of T-REX smart contracts are described in the [T-REX documentation](https://docs.t-rex.network)
|
|
120
118
|
|
|
121
119
|
## Contributing
|
|
122
120
|
|
|
123
121
|
We welcome contributions from the community. Please refer to the [CONTRIBUTING](./CONTRIBUTING.md) guide for more details.
|
|
124
122
|
|
|
125
|
-
##
|
|
123
|
+
## Security and audits
|
|
126
124
|
|
|
127
|
-
|
|
125
|
+
T-REX v5 has been audited by OpenZeppelin. The audit report will be linked here once published.
|
|
128
126
|
|
|
129
|
-
|
|
127
|
+
Please report security vulnerabilities responsibly to security@t-rex.network rather than opening a public issue.
|
|
130
128
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
Copyright (C) 2026 Digital Asset Operational Services ISAC Ltd. ("T-REX Network").
|
|
132
|
+
|
|
133
|
+
This project is licensed under the GNU General Public License v3.0. See [LICENSE.md](./LICENSE.md) for the full license text and [NOTICE.md](./NOTICE.md) for copyright, provenance, and trademark information.
|
|
136
134
|
|
|
137
|
-
---
|
|
@@ -37,46 +37,73 @@
|
|
|
37
37
|
// :#%%=
|
|
38
38
|
//
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
*/
|
|
40
|
+
// T-REX Smart Contracts
|
|
41
|
+
// The ERC-3643 token suite of the T-REX ecosystem.
|
|
42
|
+
//
|
|
43
|
+
// Copyright (C) 2026 Digital Asset Operational Services ISAC Ltd. ("T-REX Network")
|
|
44
|
+
//
|
|
45
|
+
// This file is part of the T-REX smart contract suite.
|
|
46
|
+
//
|
|
47
|
+
// This program is free software: you can redistribute it and/or modify
|
|
48
|
+
// it under the terms of the GNU General Public License as published by
|
|
49
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
50
|
+
// (at your option) any later version.
|
|
51
|
+
//
|
|
52
|
+
// This program is distributed in the hope that it will be useful,
|
|
53
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
54
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
55
|
+
// GNU General Public License for more details.
|
|
56
|
+
//
|
|
57
|
+
// You should have received a copy of the GNU General Public License
|
|
58
|
+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
63
59
|
|
|
64
60
|
pragma solidity 0.8.30;
|
|
65
61
|
|
|
66
|
-
|
|
62
|
+
/// @title ERC3643ErrorsLib
|
|
63
|
+
/// @notice The errors raised by the ERC-3643 standard bases in `contracts/ERC-3643/base/`.
|
|
64
|
+
/// @dev The standard bases may not import from the T-REX layer, so their errors live here rather than in
|
|
65
|
+
/// `ErrorsLib`, which re-declares the same names. Same signature means same selector, so a caller
|
|
66
|
+
/// catching either gets the same result.
|
|
67
|
+
library ERC3643ErrorsLib {
|
|
68
|
+
|
|
69
|
+
// Common
|
|
70
|
+
error ZeroAddress();
|
|
71
|
+
|
|
72
|
+
// Batch
|
|
73
|
+
/// @dev A batch call whose arrays differ in length. Unchecked, a short first array would silently
|
|
74
|
+
/// skip the trailing entries and still succeed.
|
|
75
|
+
error ArrayLengthMismatch();
|
|
76
|
+
|
|
77
|
+
// Token
|
|
78
|
+
error AmountAboveFrozenTokens(uint256 amount, uint256 maxAmount);
|
|
79
|
+
error ComplianceNotFollowed();
|
|
80
|
+
error FrozenWallet(address user);
|
|
81
|
+
error UnverifiedIdentity();
|
|
67
82
|
|
|
68
|
-
|
|
83
|
+
// Compliance
|
|
84
|
+
error AddressNotATokenBoundToComplianceContract();
|
|
85
|
+
error TokenNotBound();
|
|
69
86
|
|
|
70
|
-
|
|
87
|
+
// ClaimTopicsRegistry
|
|
88
|
+
error ClaimTopicAlreadyExists();
|
|
89
|
+
error MaxClaimTopicsReached(uint256 max);
|
|
71
90
|
|
|
72
|
-
|
|
91
|
+
// TrustedIssuersRegistry
|
|
92
|
+
error MaxTrustedIssuersReached(uint256 max);
|
|
93
|
+
error NotATrustedIssuer();
|
|
94
|
+
/// @dev Raised by `addTrustedIssuer` when the issuer is registered with no claim topics.
|
|
95
|
+
error TrustedClaimTopicsCannotBeEmpty();
|
|
73
96
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
97
|
+
/// @dev Raised by `updateIssuerClaimTopics` when the new topic set is empty. Distinct from
|
|
98
|
+
/// `TrustedClaimTopicsCannotBeEmpty` so callers can tell the two entry points apart.
|
|
99
|
+
error ClaimTopicsCannotBeEmpty();
|
|
100
|
+
error TrustedIssuerAlreadyExists();
|
|
101
|
+
error TrustedIssuerHasNoCode(address issuer);
|
|
77
102
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
103
|
+
// IdentityRegistryStorage
|
|
104
|
+
error AddressAlreadyStored();
|
|
105
|
+
error AddressNotYetStored();
|
|
106
|
+
error IdentityRegistryNotStored();
|
|
107
|
+
error MaxIRByIRSReached(uint256 max);
|
|
81
108
|
|
|
82
109
|
}
|
|
@@ -46,12 +46,57 @@ import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/I
|
|
|
46
46
|
|
|
47
47
|
interface IERC3643 is IERC20, IERC20Metadata {
|
|
48
48
|
|
|
49
|
+
/// @dev Emitted when the token information is updated, at deployment and on every metadata change.
|
|
50
|
+
/// @param _newName The new name of the token.
|
|
51
|
+
/// @param _newSymbol The new symbol of the token.
|
|
52
|
+
/// @param _newDecimals The number of decimals of the token.
|
|
53
|
+
/// @param _newVersion The version of the token implementation.
|
|
54
|
+
/// @param _newOnchainID The address of the token's ONCHAINID.
|
|
55
|
+
event UpdatedTokenInformation(
|
|
56
|
+
string _newName, string _newSymbol, uint8 _newDecimals, string _newVersion, address indexed _newOnchainID
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
/// @dev Emitted when the Identity Registry bound to the token is set or replaced.
|
|
60
|
+
/// @param _identityRegistry The address of the Identity Registry.
|
|
61
|
+
event IdentityRegistryAdded(address indexed _identityRegistry);
|
|
62
|
+
|
|
63
|
+
/// @dev Emitted when the Compliance contract bound to the token is set or replaced.
|
|
64
|
+
/// @param _compliance The address of the Compliance contract.
|
|
65
|
+
event ComplianceAdded(address indexed _compliance);
|
|
66
|
+
|
|
67
|
+
/// @dev Emitted when a wallet recovery succeeds and the balance moves to the new wallet.
|
|
68
|
+
/// @param _lostWallet The address of the wallet that lost access.
|
|
69
|
+
/// @param _newWallet The address of the replacement wallet.
|
|
70
|
+
/// @param _investorOnchainID The address of the investor's ONCHAINID.
|
|
71
|
+
event RecoverySuccess(address indexed _lostWallet, address indexed _newWallet, address indexed _investorOnchainID);
|
|
72
|
+
|
|
73
|
+
/// @dev Emitted when a wallet's frozen status changes.
|
|
74
|
+
/// @notice `_owner` records the actor that set the frozen status (`_msgSender()`). When the call is
|
|
75
|
+
/// routed through `AccessManager.execute`, `_msgSender()` is the AccessManager, so this field
|
|
76
|
+
/// reflects the executing contract rather than the originator address (the EOA or contract behind
|
|
77
|
+
/// the role). Consumers that need the originator address must read it from the AccessManager
|
|
78
|
+
/// execution context, not here.
|
|
79
|
+
/// @param _userAddress The address of the wallet whose status changed.
|
|
80
|
+
/// @param _isFrozen The new frozen status.
|
|
81
|
+
/// @param _owner The actor that set the status.
|
|
82
|
+
event AddressFrozen(address indexed _userAddress, bool indexed _isFrozen, address indexed _owner);
|
|
83
|
+
|
|
84
|
+
/// @dev Emitted when part of a wallet's balance is frozen.
|
|
85
|
+
/// @param _userAddress The address of the wallet.
|
|
86
|
+
/// @param _amount The amount of tokens frozen.
|
|
87
|
+
event TokensFrozen(address indexed _userAddress, uint256 _amount);
|
|
88
|
+
|
|
89
|
+
/// @dev Emitted when part of a wallet's frozen balance is released.
|
|
90
|
+
/// @param _userAddress The address of the wallet.
|
|
91
|
+
/// @param _amount The amount of tokens unfrozen.
|
|
92
|
+
event TokensUnfrozen(address indexed _userAddress, uint256 _amount);
|
|
93
|
+
|
|
49
94
|
/// Functions
|
|
50
95
|
/// Setters
|
|
51
96
|
/**
|
|
52
97
|
* @dev sets the token name
|
|
53
98
|
* @param _name the name of token to set
|
|
54
|
-
*
|
|
99
|
+
* Restricted to the configured AccessManager role (TOKEN_MANAGER).
|
|
55
100
|
* emits a `UpdatedTokenInformation` event
|
|
56
101
|
*/
|
|
57
102
|
function setName(string calldata _name) external;
|
|
@@ -59,7 +104,7 @@ interface IERC3643 is IERC20, IERC20Metadata {
|
|
|
59
104
|
/**
|
|
60
105
|
* @dev sets the token symbol
|
|
61
106
|
* @param _symbol the token symbol to set
|
|
62
|
-
*
|
|
107
|
+
* Restricted to the configured AccessManager role (TOKEN_MANAGER).
|
|
63
108
|
* emits a `UpdatedTokenInformation` event
|
|
64
109
|
*/
|
|
65
110
|
function setSymbol(string calldata _symbol) external;
|
|
@@ -67,7 +112,7 @@ interface IERC3643 is IERC20, IERC20Metadata {
|
|
|
67
112
|
/**
|
|
68
113
|
* @dev sets the onchain ID of the token
|
|
69
114
|
* @param _onchainID the address of the onchain ID to set
|
|
70
|
-
*
|
|
115
|
+
* Restricted to the configured AccessManager role (IDENTITY_MANAGER).
|
|
71
116
|
* emits a `UpdatedTokenInformation` event
|
|
72
117
|
*/
|
|
73
118
|
function setOnchainID(address _onchainID) external;
|
|
@@ -101,6 +146,10 @@ interface IERC3643 is IERC20, IERC20Metadata {
|
|
|
101
146
|
* either freezing or unfreezing the address based on the provided boolean value.
|
|
102
147
|
* This function can be called by an agent of the token, assuming the agent is not restricted from freezing addresses.
|
|
103
148
|
* emits an `AddressFrozen` event upon successful execution.
|
|
149
|
+
* @notice The `_owner` field of the emitted `AddressFrozen` event is `_msgSender()`. When this
|
|
150
|
+
* function is invoked through `AccessManager.execute`, `_msgSender()` is the AccessManager, so the
|
|
151
|
+
* event records the executing contract, not the originator address. This is intentional; read the
|
|
152
|
+
* AccessManager execution context if you need the originator address (the EOA or contract).
|
|
104
153
|
* @param _userAddress The address for which to update the frozen status.
|
|
105
154
|
* @param _freeze The frozen status to be applied: `true` to freeze, `false` to unfreeze.
|
|
106
155
|
* @notice To change an address's frozen status, the calling agent must have the capability to freeze addresses enabled.
|
|
@@ -139,15 +188,18 @@ interface IERC3643 is IERC20, IERC20Metadata {
|
|
|
139
188
|
/**
|
|
140
189
|
* @dev sets the Identity Registry for the token
|
|
141
190
|
* @param _identityRegistry the address of the Identity Registry to set
|
|
142
|
-
*
|
|
191
|
+
* Restricted to the configured AccessManager role (IDENTITY_MANAGER).
|
|
143
192
|
* emits an `IdentityRegistryAdded` event
|
|
193
|
+
* @notice The provided Identity Registry must share the Token's AccessManager authority, otherwise
|
|
194
|
+
* reverts with `AuthorityMismatch`. This guards against misconfiguration only, not a malicious caller:
|
|
195
|
+
* authorization (IDENTITY_MANAGER) remains the real trust boundary.
|
|
144
196
|
*/
|
|
145
197
|
function setIdentityRegistry(address _identityRegistry) external;
|
|
146
198
|
|
|
147
199
|
/**
|
|
148
200
|
* @dev sets the compliance contract of the token
|
|
149
201
|
* @param _compliance the address of the compliance contract to set
|
|
150
|
-
*
|
|
202
|
+
* Restricted to the configured AccessManager role (IDENTITY_MANAGER).
|
|
151
203
|
* calls bindToken on the compliance contract
|
|
152
204
|
* emits a `ComplianceAdded` event
|
|
153
205
|
*/
|
|
@@ -235,6 +287,8 @@ interface IERC3643 is IERC20, IERC20Metadata {
|
|
|
235
287
|
* - Updates the identity registry:
|
|
236
288
|
* - If `_lostWallet` is listed in the identity registry, it will be removed,
|
|
237
289
|
* and `_newWallet` will be registered unless already present.
|
|
290
|
+
* - Tells the compliance contract about the move, as a transfer from `_lostWallet` to `_newWallet`,
|
|
291
|
+
* so that modules tracking balances stay in sync with the token.
|
|
238
292
|
*
|
|
239
293
|
* Emits the following events:
|
|
240
294
|
* - `TokensUnfrozen` if there are frozen tokens on `_lostWallet` that are transferred.
|
|
@@ -244,6 +298,7 @@ interface IERC3643 is IERC20, IERC20Metadata {
|
|
|
244
298
|
* - `RecoverySuccess` upon successful completion of the recovery process.
|
|
245
299
|
*
|
|
246
300
|
* Reverts if:
|
|
301
|
+
* - The contract is paused (`EnforcedPause`): recovery moves a balance and waits for the halt to be lifted.
|
|
247
302
|
* - The agent calling the function does not have the necessary permissions to perform recovery (`AgentNotAuthorized`).
|
|
248
303
|
* - The `_lostWallet` has no tokens to recover (`NoTokenToRecover`).
|
|
249
304
|
* - Neither `_lostWallet` nor `_newWallet` is present in the identity registry (`RecoveryNotPossible`).
|
|
@@ -284,6 +339,7 @@ interface IERC3643 is IERC20, IERC20Metadata {
|
|
|
284
339
|
* Also emits _fromList.length `Transfer` events upon successful batch transfer.
|
|
285
340
|
* To execute this function, the calling agent must not be restricted from initiating forced transfer.
|
|
286
341
|
* If the agent is restricted from this capability, the function call will fail.
|
|
342
|
+
* The function can only be called when the contract is not paused.
|
|
287
343
|
*/
|
|
288
344
|
function batchForcedTransfer(address[] calldata _fromList, address[] calldata _toList, uint256[] calldata _amounts)
|
|
289
345
|
external;
|
|
@@ -36,13 +36,22 @@
|
|
|
36
36
|
// +@@@@%-
|
|
37
37
|
// :#%%=
|
|
38
38
|
//
|
|
39
|
+
|
|
39
40
|
pragma solidity 0.8.30;
|
|
40
41
|
|
|
41
42
|
interface IERC3643ClaimTopicsRegistry {
|
|
42
43
|
|
|
44
|
+
/// @dev Emitted when a claim topic has been added to the requirement list.
|
|
45
|
+
/// @param _claimTopic The claim topic that has been added.
|
|
46
|
+
event ClaimTopicAdded(uint256 indexed _claimTopic);
|
|
47
|
+
|
|
48
|
+
/// @dev Emitted when a claim topic has been removed from the requirement list.
|
|
49
|
+
/// @param _claimTopic The claim topic that has been removed.
|
|
50
|
+
event ClaimTopicRemoved(uint256 indexed _claimTopic);
|
|
51
|
+
|
|
43
52
|
/**
|
|
44
53
|
* @dev Add a trusted claim topic (For example: KYC=1, AML=2).
|
|
45
|
-
*
|
|
54
|
+
* Restricted to the configured AccessManager role (OWNER).
|
|
46
55
|
* emits `ClaimTopicAdded` event
|
|
47
56
|
* cannot add more than 15 topics for 1 token as adding more could create gas issues
|
|
48
57
|
* @param _claimTopic The claim topic index
|
|
@@ -51,7 +60,7 @@ interface IERC3643ClaimTopicsRegistry {
|
|
|
51
60
|
|
|
52
61
|
/**
|
|
53
62
|
* @dev Remove a trusted claim topic (For example: KYC=1, AML=2).
|
|
54
|
-
*
|
|
63
|
+
* Restricted to the configured AccessManager role (OWNER).
|
|
55
64
|
* emits `ClaimTopicRemoved` event
|
|
56
65
|
* @param _claimTopic The claim topic index
|
|
57
66
|
*/
|
|
@@ -36,16 +36,25 @@
|
|
|
36
36
|
// +@@@@%-
|
|
37
37
|
// :#%%=
|
|
38
38
|
//
|
|
39
|
+
|
|
39
40
|
pragma solidity 0.8.30;
|
|
40
41
|
|
|
41
42
|
interface IERC3643Compliance {
|
|
42
43
|
|
|
44
|
+
/// @dev Emitted when a token is bound to the compliance contract.
|
|
45
|
+
/// @param _token The address of the bound token.
|
|
46
|
+
event TokenBound(address _token);
|
|
47
|
+
|
|
48
|
+
/// @dev Emitted when a token is unbound from the compliance contract.
|
|
49
|
+
/// @param _token The address of the unbound token.
|
|
50
|
+
event TokenUnbound(address _token);
|
|
51
|
+
|
|
43
52
|
/// Functions
|
|
44
53
|
/// initialization of the compliance contract
|
|
45
54
|
/**
|
|
46
55
|
* @dev binds a token to the compliance contract
|
|
47
56
|
* @param _token address of the token to bind
|
|
48
|
-
*
|
|
57
|
+
* Callable by the AccessManager-configured role or by the bound token itself.
|
|
49
58
|
* Emits a TokenBound event
|
|
50
59
|
*/
|
|
51
60
|
function bindToken(address _token) external;
|
|
@@ -53,7 +62,7 @@ interface IERC3643Compliance {
|
|
|
53
62
|
/**
|
|
54
63
|
* @dev unbinds a token from the compliance contract
|
|
55
64
|
* @param _token address of the token to unbind
|
|
56
|
-
*
|
|
65
|
+
* Callable by the AccessManager-configured role or by the bound token itself.
|
|
57
66
|
* Emits a TokenUnbound event
|
|
58
67
|
*/
|
|
59
68
|
function unbindToken(address _token) external;
|
|
@@ -70,7 +79,7 @@ interface IERC3643Compliance {
|
|
|
70
79
|
* @param _from The address of the sender
|
|
71
80
|
* @param _to The address of the receiver
|
|
72
81
|
* @param _amount The amount of tokens involved in the transfer
|
|
73
|
-
* This function calls
|
|
82
|
+
* This function calls afterTransfer() on each TRACKER module bound to the compliance contract
|
|
74
83
|
*/
|
|
75
84
|
function transferred(address _from, address _to, uint256 _amount) external;
|
|
76
85
|
|
|
@@ -83,7 +92,8 @@ interface IERC3643Compliance {
|
|
|
83
92
|
* This function can be called ONLY by the token contract bound to the compliance
|
|
84
93
|
* @param _to The address of the receiver
|
|
85
94
|
* @param _amount The amount of tokens involved in the minting
|
|
86
|
-
* This function calls
|
|
95
|
+
* This function calls afterTransfer() on each TRACKER module bound to the compliance contract,
|
|
96
|
+
* as a movement with a zero sender side
|
|
87
97
|
*/
|
|
88
98
|
function created(address _to, uint256 _amount) external;
|
|
89
99
|
|
|
@@ -96,7 +106,8 @@ interface IERC3643Compliance {
|
|
|
96
106
|
* This function can be called ONLY by the token contract bound to the compliance
|
|
97
107
|
* @param _from The address on which tokens are burnt
|
|
98
108
|
* @param _amount The amount of tokens involved in the burn
|
|
99
|
-
* This function calls
|
|
109
|
+
* This function calls afterTransfer() on each TRACKER module bound to the compliance contract,
|
|
110
|
+
* as a movement with a zero recipient side
|
|
100
111
|
*/
|
|
101
112
|
function destroyed(address _from, uint256 _amount) external;
|
|
102
113
|
|
|
@@ -108,9 +119,11 @@ interface IERC3643Compliance {
|
|
|
108
119
|
* @param _from The address of the sender
|
|
109
120
|
* @param _to The address of the receiver
|
|
110
121
|
* @param _amount The amount of tokens involved in the transfer
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
122
|
+
* the implementation asks every rule bound to the compliance what it allows, and returns TRUE when
|
|
123
|
+
* `_amount` is within every answer, FALSE otherwise
|
|
124
|
+
* the token also calls this function on a mint, with `_from` set to the zero address, so that distribution
|
|
125
|
+
* rules can be enforced at issuance, following the same convention as the `Transfer` event of `ERC-20`
|
|
126
|
+
* a burn does not go through this function
|
|
114
127
|
*/
|
|
115
128
|
function canTransfer(address _from, address _to, uint256 _amount) external view returns (bool);
|
|
116
129
|
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
// +@@@@%-
|
|
37
37
|
// :#%%=
|
|
38
38
|
//
|
|
39
|
+
|
|
39
40
|
pragma solidity 0.8.30;
|
|
40
41
|
|
|
41
42
|
import { IERC3643ClaimTopicsRegistry } from "./IERC3643ClaimTopicsRegistry.sol";
|
|
@@ -45,6 +46,38 @@ import { IIdentity } from "@onchain-id/solidity/contracts/interface/IIdentity.so
|
|
|
45
46
|
|
|
46
47
|
interface IERC3643IdentityRegistry {
|
|
47
48
|
|
|
49
|
+
/// @dev Emitted when the ClaimTopicsRegistry has been set for the Identity Registry.
|
|
50
|
+
/// @param _claimTopicsRegistry The address of the Claim Topics Registry.
|
|
51
|
+
event ClaimTopicsRegistrySet(address indexed _claimTopicsRegistry);
|
|
52
|
+
|
|
53
|
+
/// @dev Emitted when the IdentityRegistryStorage has been set for the Identity Registry.
|
|
54
|
+
/// @param _identityStorage The address of the Identity Registry Storage.
|
|
55
|
+
event IdentityStorageSet(address indexed _identityStorage);
|
|
56
|
+
|
|
57
|
+
/// @dev Emitted when the TrustedIssuersRegistry has been set for the Identity Registry.
|
|
58
|
+
/// @param _trustedIssuersRegistry The address of the Trusted Issuers Registry.
|
|
59
|
+
event TrustedIssuersRegistrySet(address indexed _trustedIssuersRegistry);
|
|
60
|
+
|
|
61
|
+
/// @dev Emitted when an identity is registered into the Identity Registry.
|
|
62
|
+
/// @param _investorAddress The address of the investor's wallet.
|
|
63
|
+
/// @param _identity The address of the investor's ONCHAINID.
|
|
64
|
+
event IdentityRegistered(address indexed _investorAddress, IIdentity indexed _identity);
|
|
65
|
+
|
|
66
|
+
/// @dev Emitted when an identity is removed from the Identity Registry.
|
|
67
|
+
/// @param _investorAddress The address of the investor's wallet.
|
|
68
|
+
/// @param _identity The address of the investor's ONCHAINID.
|
|
69
|
+
event IdentityRemoved(address indexed _investorAddress, IIdentity indexed _identity);
|
|
70
|
+
|
|
71
|
+
/// @dev Emitted when an identity contract is replaced in the Identity Registry.
|
|
72
|
+
/// @param _oldIdentity The old ONCHAINID address.
|
|
73
|
+
/// @param _newIdentity The new ONCHAINID address.
|
|
74
|
+
event IdentityUpdated(IIdentity indexed _oldIdentity, IIdentity indexed _newIdentity);
|
|
75
|
+
|
|
76
|
+
/// @dev Emitted when an investor's country is updated in the Identity Registry.
|
|
77
|
+
/// @param _investorAddress The address of the investor's wallet.
|
|
78
|
+
/// @param _country The investor's new country code (ISO-3166).
|
|
79
|
+
event CountryUpdated(address indexed _investorAddress, uint16 indexed _country);
|
|
80
|
+
|
|
48
81
|
/// Functions
|
|
49
82
|
/// Identity Registry Setters
|
|
50
83
|
/**
|