@t-rex-network/t-rex 4.2.0-beta1 → 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 +24 -27
- 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 +14 -11
- 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
|
@@ -36,60 +36,100 @@
|
|
|
36
36
|
// +@@@@%-
|
|
37
37
|
// :#%%=
|
|
38
38
|
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
39
|
+
|
|
40
|
+
// T-REX Smart Contracts
|
|
41
|
+
// The ERC-3643 token suite of the T-REX ecosystem.
|
|
42
|
+
//
|
|
43
|
+
// Copyright (C) 2023, Tokeny sàrl.
|
|
44
|
+
// Copyright (C) 2026 Digital Asset Operational Services ISAC Ltd. ("T-REX Network")
|
|
45
|
+
//
|
|
46
|
+
// This file is part of the T-REX smart contract suite. It derives from the
|
|
47
|
+
// T-REX v4 smart contracts developed by Tokeny sàrl and released under the
|
|
48
|
+
// GNU General Public License v3. All modifications made since then are the
|
|
49
|
+
// work of Digital Asset Operational Services ISAC Ltd. ("T-REX Network").
|
|
50
|
+
//
|
|
51
|
+
// This program is free software: you can redistribute it and/or modify
|
|
52
|
+
// it under the terms of the GNU General Public License as published by
|
|
53
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
54
|
+
// (at your option) any later version.
|
|
55
|
+
//
|
|
56
|
+
// This program is distributed in the hope that it will be useful,
|
|
57
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
58
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
59
|
+
// GNU General Public License for more details.
|
|
60
|
+
//
|
|
61
|
+
// You should have received a copy of the GNU General Public License
|
|
62
|
+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
62
63
|
|
|
63
64
|
pragma solidity 0.8.30;
|
|
64
65
|
|
|
65
66
|
import { IERC3643Compliance } from "../../ERC-3643/IERC3643Compliance.sol";
|
|
67
|
+
import { IModule } from "./modules/IModule.sol";
|
|
66
68
|
|
|
67
69
|
interface IModularCompliance is IERC3643Compliance {
|
|
68
70
|
|
|
71
|
+
event ModuleInteraction(address indexed target, bytes data);
|
|
72
|
+
event ModuleAdded(address indexed module);
|
|
73
|
+
event ModuleTypesRecorded(address indexed module, IModule.ModuleType[] moduleTypes);
|
|
74
|
+
|
|
75
|
+
error ComplianceNotSuitableForBindingToModule(address module);
|
|
76
|
+
error MaxModulesReached(uint256 maxValue);
|
|
77
|
+
error ModuleAlreadyBound();
|
|
78
|
+
error ModuleHasNoType();
|
|
79
|
+
error DuplicateModuleType(uint8 moduleType);
|
|
80
|
+
error ModuleNotBound();
|
|
81
|
+
|
|
69
82
|
/// functions
|
|
70
83
|
/**
|
|
71
84
|
* @dev adds a module to the list of compliance modules
|
|
72
85
|
* @param _module address of the module to add
|
|
73
86
|
* there cannot be more than 25 modules bound to the modular compliance for gas cost reasons
|
|
74
|
-
*
|
|
75
|
-
*
|
|
87
|
+
* the module must name at least one type in `moduleTypes`, and it is sorted into the list of each type
|
|
88
|
+
* it names, so the compliance only calls it where it said it answers
|
|
89
|
+
* Restricted to the configured AccessManager role (OWNER).
|
|
90
|
+
* Emits a ModuleAdded event and a ModuleTypesRecorded event
|
|
76
91
|
*/
|
|
77
92
|
function addModule(address _module) external;
|
|
78
93
|
|
|
94
|
+
/**
|
|
95
|
+
* @dev re-reads what a bound module says it is and files it again
|
|
96
|
+
* @param _module address of the bound module to resynchronise
|
|
97
|
+
* a module sits behind a proxy, so an implementation upgrade can change what `moduleTypes` answers while
|
|
98
|
+
* this compliance still routes by what it recorded at binding. Until this is called, the compliance keeps
|
|
99
|
+
* calling the module for a type it dropped, which reverts on every movement, and never calls it for a type
|
|
100
|
+
* it gained
|
|
101
|
+
* removing and re-adding the module is not the same thing: an unbind increments the module's bind nonce,
|
|
102
|
+
* which is how a module scopes its per-compliance settings, so the rebound module comes back unconfigured
|
|
103
|
+
* Restricted to the configured AccessManager role (OWNER).
|
|
104
|
+
* Emits a ModuleTypesRecorded event, including when nothing changed
|
|
105
|
+
*/
|
|
106
|
+
function resyncModuleTypes(address _module) external;
|
|
107
|
+
|
|
79
108
|
/**
|
|
80
109
|
* @dev removes a module from the list of compliance modules
|
|
81
110
|
* @param _module address of the module to remove
|
|
82
|
-
*
|
|
111
|
+
* Restricted to the configured AccessManager role (OWNER).
|
|
83
112
|
* Emits a ModuleRemoved event
|
|
84
113
|
*/
|
|
85
114
|
function removeModule(address _module) external;
|
|
86
115
|
|
|
116
|
+
/**
|
|
117
|
+
* @dev removes a module from the list of compliance modules without calling it, for a module that
|
|
118
|
+
* reverts on `unbindCompliance` or everywhere. The module keeps its own binding record, so the same
|
|
119
|
+
* address cannot be added again; a fresh deployment can.
|
|
120
|
+
* @param _module address of the module to remove
|
|
121
|
+
* Restricted to the configured AccessManager role (OWNER).
|
|
122
|
+
* Emits a ModuleForceRemoved event and no ModuleRemoved, so indexers can tell a forced removal
|
|
123
|
+
* from a regular one
|
|
124
|
+
*/
|
|
125
|
+
function forceRemoveModule(address _module) external;
|
|
126
|
+
|
|
87
127
|
/**
|
|
88
128
|
* @dev calls any function on bound modules
|
|
89
129
|
* can be called only on bound modules
|
|
90
130
|
* @param callData the bytecode for interaction with the module, abi encoded
|
|
91
131
|
* @param _module The address of the module
|
|
92
|
-
*
|
|
132
|
+
* Restricted to the configured AccessManager role (OWNER).
|
|
93
133
|
* emits a `ModuleInteraction` event
|
|
94
134
|
*/
|
|
95
135
|
function callModuleFunction(bytes calldata callData, address _module) external;
|
|
@@ -107,7 +147,7 @@ interface IModularCompliance is IERC3643Compliance {
|
|
|
107
147
|
* These interactions are performed after the module is added.
|
|
108
148
|
*
|
|
109
149
|
* Requirements:
|
|
110
|
-
* - The caller must
|
|
150
|
+
* - The caller must hold the required AccessManager role (OWNER).
|
|
111
151
|
* - The `_module` address must not be a zero address.
|
|
112
152
|
* - The `_module` must not already be bound to the contract.
|
|
113
153
|
* - The total number of modules must not exceed 25 after adding the new module.
|
|
@@ -134,6 +174,57 @@ interface IModularCompliance is IERC3643Compliance {
|
|
|
134
174
|
*/
|
|
135
175
|
function getModules() external view returns (address[] memory);
|
|
136
176
|
|
|
177
|
+
/**
|
|
178
|
+
* @dev checks whether every bound module allows `_spender` to move `_value` from `_from` to `_to`
|
|
179
|
+
* @param _spender address initiating the transfer on behalf of `_from`
|
|
180
|
+
* @param _from address of the transfer sender
|
|
181
|
+
* @param _to address of the transfer receiver
|
|
182
|
+
* @param _value amount of tokens sent
|
|
183
|
+
* only the `SPENDER` modules are consulted, and all of them must agree; they receive the same resolved
|
|
184
|
+
* context as a rule, with the spender as a native ERC-7930 envelope
|
|
185
|
+
* a direct transfer needs no spender check: the spender is the sender, already covered by
|
|
186
|
+
* {canTransfer}
|
|
187
|
+
* returns true when no bound module objects, including when none enforces a spender rule
|
|
188
|
+
* only the bound token may call it, right before its `transferFrom` moves anything: `_spender` is kept
|
|
189
|
+
* for the rest of that transfer, so the `RULE` and `TRACKER` modules see it in their context too
|
|
190
|
+
*/
|
|
191
|
+
function canSpenderCall(address _spender, address _from, address _to, uint256 _value) external returns (bool);
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @dev function called whenever the token moves tokens outside a plain transfer: a forced transfer or a
|
|
195
|
+
* recovery by an agent, or a delegation out to a satellite wallet, which the holder, the holder's identity
|
|
196
|
+
* or an agent may start
|
|
197
|
+
* the standard `transferred` cannot say what moved the tokens, and a module counting an investor's own
|
|
198
|
+
* activity must tell these movements apart, so the token reports them here with the kind they were,
|
|
199
|
+
* `FORCED_TRANSFER`, `RECOVERY` or `DELEGATION` from `MovementKindLib`, and the trackers see them under
|
|
200
|
+
* that kind
|
|
201
|
+
* no rule is asked: the token checked the movement itself, see the token
|
|
202
|
+
* the token is trusted with `_kind`: it is the only caller and the kind is its own operation
|
|
203
|
+
* This function can be called ONLY by the token bound to the compliance
|
|
204
|
+
* @param _from address of the wallet the tokens left
|
|
205
|
+
* @param _to address of the wallet the tokens landed on
|
|
206
|
+
* @param _amount amount of tokens moved
|
|
207
|
+
* @param _kind which operation moved them, a `MovementKindLib` constant
|
|
208
|
+
*/
|
|
209
|
+
function agentTransferred(address _from, address _to, uint256 _amount, uint8 _kind) external;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @dev getter for the bound modules of one type, in the order they were bound
|
|
213
|
+
* @param moduleType which modules to list, see {IModule-ModuleType}
|
|
214
|
+
* a module that named several types appears in each of their lists
|
|
215
|
+
*/
|
|
216
|
+
function getModulesByType(IModule.ModuleType moduleType) external view returns (address[] memory);
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @dev settles who owns a native wallet before tokens land on it outside a movement the compliance hears
|
|
220
|
+
* of, a recall's credit: an empty wallet the registry relinked takes its new owner, a funded one reverts
|
|
221
|
+
* with `WalletBoundToAnotherIdentity` until the registry names the owner the ledger credited. No movement
|
|
222
|
+
* is counted and no module is called. A no-op when the owner has not changed.
|
|
223
|
+
* This function can be called ONLY by the token bound to the compliance
|
|
224
|
+
* @param _wallet the native wallet about to be credited
|
|
225
|
+
*/
|
|
226
|
+
function syncOwner(address _wallet) external;
|
|
227
|
+
|
|
137
228
|
/**
|
|
138
229
|
* @dev checks if a module is bound to the compliance contract
|
|
139
230
|
* returns true if module is bound, false otherwise
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
2
|
+
//
|
|
3
|
+
// :+#####%%%%%%%%%%%%%%+
|
|
4
|
+
// .-*@@@%+.:+%@@@@@%%#***%@@%=
|
|
5
|
+
// :=*%@@@#=. :#@@% *@@@%=
|
|
6
|
+
// .-+*%@%*-.:+%@@@@@@+. -*+: .=#. :%@@@%-
|
|
7
|
+
// :=*@@@@%%@@@@@@@@@%@@@- .=#@@@%@%= =@@@@#.
|
|
8
|
+
// -=+#%@@%#*=:. :%@@@@%. -*@@#*@@@@@@@#=:- *@@@@+
|
|
9
|
+
// =@@%=:. :=: *@@@@@%#- =%*%@@@@#+-. =+ :%@@@%-
|
|
10
|
+
// -@@%. .+@@@ =+=-. @@#- +@@@%- =@@@@%:
|
|
11
|
+
// :@@@. .+@@#%: : .=*=-::.-%@@@+*@@= +@@@@#.
|
|
12
|
+
// %@@: +@%%* =%@@@@@@@@@@@#. .*@%- +@@@@*.
|
|
13
|
+
// #@@= .+@@@@%:=*@@@@@- :%@%: .*@@@@+
|
|
14
|
+
// *@@* +@@@#-@@%-:%@@* +@@#. :%@@@@-
|
|
15
|
+
// -@@% .:-=++*##%%%@@@@@@@@@@@@*. :@+.@@@%: .#@@+ =@@@@#:
|
|
16
|
+
// .@@@*-+*#%%%@@@@@@@@@@@@@@@@%%#**@@%@@@. *@=*@@# :#@%= .#@@@@#-
|
|
17
|
+
// -%@@@@@@@@@@@@@@@*+==-:-@@@= *@# .#@*-=*@@@@%= -%@@@* =@@@@@%-
|
|
18
|
+
// -+%@@@#. %@%%= -@@:+@: -@@* *@@*-:: -%@@%=. .*@@@@@#
|
|
19
|
+
// *@@@* +@* *@@##@@- #@*@@+ -@@= . :+@@@#: .-+@@@%+-
|
|
20
|
+
// +@@@%*@@:..=@@@@* .@@@* .#@#. .=+- .=%@@@*. :+#@@@@*=:
|
|
21
|
+
// =@@@@%@@@@@@@@@@@@@@@@@@@@@@%- :+#*. :*@@@%=. .=#@@@@%+:
|
|
22
|
+
// .%@@= ..... .=#@@+. .#@@@*: -*%@@@@%+.
|
|
23
|
+
// +@@#+===---:::... .=%@@*- +@@@+. -*@@@@@%+.
|
|
24
|
+
// -@@@@@@@@@@@@@@@@@@@@@@%@@@@= -@@@+ -#@@@@@#=.
|
|
25
|
+
// ..:::---===+++***###%%%@@@#- .#@@+ -*@@@@@#=.
|
|
26
|
+
// @@@@@@+. +@@*. .+@@@@@%=.
|
|
27
|
+
// -@@@@@= =@@%: -#@@@@%+.
|
|
28
|
+
// +@@@@@. =@@@= .+@@@@@*:
|
|
29
|
+
// #@@@@#:%@@#. :*@@@@#-
|
|
30
|
+
// @@@@@%@@@= :#@@@@+.
|
|
31
|
+
// :@@@@@@@#.:#@@@%-
|
|
32
|
+
// +@@@@@@-.*@@@*:
|
|
33
|
+
// #@@@@#.=@@@+.
|
|
34
|
+
// @@@@+-%@%=
|
|
35
|
+
// :@@@#%@%=
|
|
36
|
+
// +@@@@%-
|
|
37
|
+
// :#%%=
|
|
38
|
+
//
|
|
39
|
+
|
|
40
|
+
// 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/>.
|
|
59
|
+
pragma solidity 0.8.30;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @title ITransferValidation
|
|
63
|
+
* @dev The compliance's issuance surface for satellite movements: the two windows a COMPLIANCE_MANAGER tunes, the
|
|
64
|
+
* per-chain issuance pause, the lifecycle of every issued validation and the keeper's discard. A satellite
|
|
65
|
+
* executes a transfer only against a `ComplianceValidation` the reference chain issued for that exact transfer;
|
|
66
|
+
* this is where it comes from. A ceiling on what may be issued is a rule, not a setting: a module answers it
|
|
67
|
+
* from `allowedAmount`.
|
|
68
|
+
*/
|
|
69
|
+
interface ITransferValidation {
|
|
70
|
+
|
|
71
|
+
event TransferValidationIssued(
|
|
72
|
+
uint256 indexed validationId,
|
|
73
|
+
bytes from,
|
|
74
|
+
bytes to,
|
|
75
|
+
bytes spender,
|
|
76
|
+
uint256 amountMin,
|
|
77
|
+
uint256 amountMax,
|
|
78
|
+
uint64 expiry,
|
|
79
|
+
uint64 reconciliationWindow
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
/// @dev Every state a validation can be in. This is the whole lifecycle: which legs have arrived, whether
|
|
83
|
+
/// the keeper gave up, and what is still reserved are all read off this one value.
|
|
84
|
+
///
|
|
85
|
+
/// What is reserved is derived rather than stored, so the two can never disagree:
|
|
86
|
+
/// - the identities' pending amounts are outstanding in `Pending`, `AwaitingMint` and `AwaitingBurn`, and
|
|
87
|
+
/// never on a relocation, where nothing was reserved for them in the first place;
|
|
88
|
+
/// - the sender wallet's pending amount is outstanding in `Pending` and `AwaitingBurn` alone, because a burn
|
|
89
|
+
/// leg has already taken the tokens out of that wallet and into transit.
|
|
90
|
+
enum ValidationStatus {
|
|
91
|
+
/// Issued, amounts reserved, waiting for the settlement notification(s).
|
|
92
|
+
Pending,
|
|
93
|
+
/// Two-leg only: the burn leg arrived, the mint leg is still owed. The amount has left the sender's
|
|
94
|
+
/// position and waits in transit on the token. Never discardable and never derived `Expired`, because a
|
|
95
|
+
/// consumed leg proves the satellite has irreversibly executed its half.
|
|
96
|
+
AwaitingMint,
|
|
97
|
+
/// Two-leg only: the mint leg arrived, the burn leg is still owed.
|
|
98
|
+
AwaitingBurn,
|
|
99
|
+
/// Every expected leg arrived: reservation released, positions and token ledger updated.
|
|
100
|
+
Settled,
|
|
101
|
+
/// Derived, never stored: `Pending` and past `releaseAt`, not yet discarded.
|
|
102
|
+
Expired,
|
|
103
|
+
/// Discarded and the reservation released; issuance proceeds as if it never happened.
|
|
104
|
+
Discarded,
|
|
105
|
+
/// Discarded, then the burn leg arrived late. Still owed the mint leg.
|
|
106
|
+
DiscardedAwaitingMint,
|
|
107
|
+
/// Discarded, then the mint leg arrived late. Still owed the burn leg.
|
|
108
|
+
DiscardedAwaitingBurn,
|
|
109
|
+
/// Every leg arrived after the discard: applied anyway, `LateReconciliation` emitted per late leg, and
|
|
110
|
+
/// that leg's chain paused for issuance when the executed amount breached a rule.
|
|
111
|
+
LateReconciled,
|
|
112
|
+
/// The keeper gave up on a pair whose other leg never arrived: whatever was held in transit went back to
|
|
113
|
+
/// the wallet it was burned from, and the reservation was released. A leg arriving now halts the token.
|
|
114
|
+
Resolved
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/// @dev Everything the compliance keeps of an issued validation, keyed by its id and kept forever: every id
|
|
118
|
+
/// stays classifiable against its stored status for good, which is what makes the emergency responses
|
|
119
|
+
/// possible.
|
|
120
|
+
///
|
|
121
|
+
/// The fields come in two groups. The first twelve are written once, at issuance, and never change: the
|
|
122
|
+
/// terms of the movement. The last seven are the lifecycle: where the validation stands, what was released,
|
|
123
|
+
/// what a satellite actually executed.
|
|
124
|
+
struct Validation {
|
|
125
|
+
/* ----- Written once, at issuance ----- */
|
|
126
|
+
|
|
127
|
+
/// EIP-712 struct hash of the issued `ComplianceValidation`, the identifier the satellite consumes.
|
|
128
|
+
bytes32 hash;
|
|
129
|
+
/// Final inclusive lower bound, so a settlement's executed amount can be classified.
|
|
130
|
+
uint256 amountMin;
|
|
131
|
+
/// Final inclusive upper bound, what the reservation was taken at.
|
|
132
|
+
uint256 amountMax;
|
|
133
|
+
/// The satellite's hard deadline: no execution at or after it.
|
|
134
|
+
uint64 expiry;
|
|
135
|
+
/// `expiry + reconciliationWindow`: past it, the reservation may be released and the validation discarded.
|
|
136
|
+
uint64 releaseAt;
|
|
137
|
+
/// `from`'s satellite chain, keyed as `MessageTypesLib.chainKey` computes it.
|
|
138
|
+
bytes32 fromChainKey;
|
|
139
|
+
/// Same for `to`'s chain; the reference chain's own key for a native wallet.
|
|
140
|
+
bytes32 toChainKey;
|
|
141
|
+
/// `keccak256` of the canonical `from` envelope: what a settlement leg's `from` is matched against.
|
|
142
|
+
bytes32 fromKey;
|
|
143
|
+
/// The sender's wallet envelope itself, kept so the reservation it holds on the token can be given back
|
|
144
|
+
/// without the caller having to supply it again.
|
|
145
|
+
bytes fromWallet;
|
|
146
|
+
/// Same for `to`.
|
|
147
|
+
bytes32 toKey;
|
|
148
|
+
/// Both sides on distinct satellite chains: two legs are expected, the burn one and the mint one.
|
|
149
|
+
bool twoLegs;
|
|
150
|
+
/// The identity `from` resolved to at issuance: whose pending amount was reserved and whose position
|
|
151
|
+
/// settlement debits.
|
|
152
|
+
address fromIdentity;
|
|
153
|
+
/// Same for `to`. Equal to `fromIdentity` on a relocation between one identity's wallets.
|
|
154
|
+
address toIdentity;
|
|
155
|
+
|
|
156
|
+
/* ----- Moved by the lifecycle ----- */
|
|
157
|
+
|
|
158
|
+
/// Both wallets belong to one identity, so nothing was ever reserved against the identities. Written
|
|
159
|
+
/// once at issuance: it is the one thing the status cannot say on its own.
|
|
160
|
+
bool relocation;
|
|
161
|
+
/// Where the validation stands. Which legs have arrived and what is still reserved are read off this;
|
|
162
|
+
/// `Expired` is never stored, it is derived from `Pending` and the clock.
|
|
163
|
+
ValidationStatus status;
|
|
164
|
+
/// Exact amount transferred, written by the first leg and repeated by the second.
|
|
165
|
+
uint256 executedAmount;
|
|
166
|
+
/// On a two-leg validation, the wallet the first consumed leg carried, kept for the second one.
|
|
167
|
+
bytes legWallet;
|
|
168
|
+
/// The spender the validation names, empty when `from` executes itself. Kept so the `TRACKER` modules
|
|
169
|
+
/// are told who executed it when it settles.
|
|
170
|
+
bytes spender;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/// @dev Issues a `ComplianceValidation` for a movement out of a satellite wallet, toward another satellite
|
|
174
|
+
/// wallet or a native one, and dispatches one leg per involved satellite chain through the token. A sender on
|
|
175
|
+
/// the reference chain is refused: the Lite that executes a validation must physically hold the position it
|
|
176
|
+
/// moves, where a native balance stays free to leave between issuance and settlement. The caller derives the
|
|
177
|
+
/// requested range from an amount and a slippage tolerance; the range is only ever narrowed: capped at `from`'s
|
|
178
|
+
/// bridged position less what is already pending out of it, then at the smallest `allowedAmount` any module
|
|
179
|
+
/// answers (skipped when both wallets belong to one identity).
|
|
180
|
+
///
|
|
181
|
+
/// Requirements:
|
|
182
|
+
/// - `requestedMin <= requestedMax`; otherwise reverts with `InvalidRequestedRange`.
|
|
183
|
+
/// - Both envelopes, and `spender` when given, canonical; otherwise `NonCanonicalInteroperableAddress`.
|
|
184
|
+
/// - `from` on a satellite chain; otherwise reverts with `SenderNotOnSatellite`.
|
|
185
|
+
/// - The caller is the identity `from` is linked to, or authorised by the AccessManager for this selector;
|
|
186
|
+
/// otherwise reverts with `NotAuthorizedForWallet`.
|
|
187
|
+
/// - A validity window set, no involved satellite chain paused, and each with a reconciliation window;
|
|
188
|
+
/// otherwise `ValidityWindowNotSet`, `ValidationIssuancePaused` or `ReconciliationWindowNotSet`.
|
|
189
|
+
/// - `from` bound to an identity (revoked included) and `to` eligible; otherwise `UnverifiedWallet`.
|
|
190
|
+
/// - A non-empty final range with a positive maximum; otherwise `EmptyValidationRange` or `ZeroValue`.
|
|
191
|
+
/// - Every involved chain open on the token; otherwise the token reverts with `ChainNotOpen`.
|
|
192
|
+
///
|
|
193
|
+
/// Emits `TransferValidationIssued`, then the token's `ValidationRoutePinned` and `ProtocolMessageSent` per leg.
|
|
194
|
+
/// @param from ERC-7930 interoperable address of the sender.
|
|
195
|
+
/// @param to ERC-7930 interoperable address of the recipient.
|
|
196
|
+
/// @param requestedMin Inclusive lower bound the caller proposes.
|
|
197
|
+
/// @param requestedMax Inclusive upper bound the caller proposes.
|
|
198
|
+
/// @param spender ERC-7930 address allowed to execute through `transferFrom`, or empty for `from` alone.
|
|
199
|
+
/// @return validationId The single-use id of the issued validation.
|
|
200
|
+
function requestTransferValidation(
|
|
201
|
+
bytes calldata from,
|
|
202
|
+
bytes calldata to,
|
|
203
|
+
uint256 requestedMin,
|
|
204
|
+
uint256 requestedMax,
|
|
205
|
+
bytes calldata spender
|
|
206
|
+
) external returns (uint256 validationId);
|
|
207
|
+
|
|
208
|
+
/// @dev Sets how long a validation stays executable on the satellite: `expiry` is issuance time plus this.
|
|
209
|
+
///
|
|
210
|
+
/// Requirements:
|
|
211
|
+
/// - The caller must hold the role bound to this selector by the AccessManager.
|
|
212
|
+
/// - `duration` must not be zero; otherwise reverts with `ZeroDuration`.
|
|
213
|
+
///
|
|
214
|
+
/// Emits `DefaultValidityWindowSet`.
|
|
215
|
+
/// @param duration The validity window in seconds.
|
|
216
|
+
function setDefaultValidityWindow(uint64 duration) external;
|
|
217
|
+
|
|
218
|
+
/// @dev Sets how long T-REX keeps a reservation past `expiry` for a leg on that chain. Snapshot at issuance,
|
|
219
|
+
/// so a later change never moves an outstanding deadline.
|
|
220
|
+
///
|
|
221
|
+
/// Requirements:
|
|
222
|
+
/// - The caller must hold the role bound to this selector by the AccessManager.
|
|
223
|
+
/// - `duration` must not be zero; otherwise reverts with `ZeroDuration`.
|
|
224
|
+
///
|
|
225
|
+
/// Emits `ReconciliationWindowSet`.
|
|
226
|
+
/// @param chainKey The chain, keyed as `MessageTypesLib.chainKey` computes it.
|
|
227
|
+
/// @param duration The window in seconds.
|
|
228
|
+
function setReconciliationWindow(bytes32 chainKey, uint64 duration) external;
|
|
229
|
+
|
|
230
|
+
/// @dev Stops or resumes issuing validations involving `chainKey`. A late reconciliation from that chain
|
|
231
|
+
/// whose executed amount breaches a rule pauses it too; lifting the pause is the explicit step after the
|
|
232
|
+
/// exception is resolved. Setting the state it already has changes nothing and emits nothing.
|
|
233
|
+
///
|
|
234
|
+
/// Requirements:
|
|
235
|
+
/// - The caller must hold the role bound to this selector by the AccessManager.
|
|
236
|
+
///
|
|
237
|
+
/// Emits `ValidationIssuancePaused` or `ValidationIssuanceUnpaused` when the state changes.
|
|
238
|
+
/// @param chainKey The chain, keyed as `MessageTypesLib.chainKey` computes it.
|
|
239
|
+
/// @param paused Whether issuance toward or from the chain is paused.
|
|
240
|
+
function setIssuancePaused(bytes32 chainKey, bool paused) external;
|
|
241
|
+
|
|
242
|
+
/// @dev Discards expired validations in a batch: releases their reservations, so the next issuance is
|
|
243
|
+
/// computed as if the pre-approved transfers never happened. Rollback is never automatic. From `releaseAt`
|
|
244
|
+
/// the keeper may discard; from the end of the second reconciliation window, one more window past
|
|
245
|
+
/// `releaseAt`, anyone may. A discard turns a leg that lands afterwards into a late reconciliation, which
|
|
246
|
+
/// can pause its chain's issuance, so the first window is the keeper's to judge; past the second the pair
|
|
247
|
+
/// would be resolvable anyway, and a reservation never stays locked on a keeper that is gone. The batch is
|
|
248
|
+
/// atomic: one refused id reverts the whole call.
|
|
249
|
+
///
|
|
250
|
+
/// A discard cannot know whether the satellite executed the validation before its deadline: the satellite
|
|
251
|
+
/// reports only what it executed. If it did and the report is still in flight, the wallet's room is given
|
|
252
|
+
/// back early, a newer validation may reserve it, and the late report still debits the wallet when it lands.
|
|
253
|
+
/// The newer one's settlement then reverts `InsufficientBridgedBalance` until the wallet is credited again;
|
|
254
|
+
/// it stays deliverable, so reconciliation is delayed, not lost. Set each chain's reconciliation window
|
|
255
|
+
/// above the longest delivery delay its gateway can have, so a report this late is not expected.
|
|
256
|
+
///
|
|
257
|
+
/// Requirements:
|
|
258
|
+
/// - Each id must have been issued; otherwise reverts with `UnknownValidation`.
|
|
259
|
+
/// - Each id must be stored `Pending`; otherwise reverts with `ValidationNotDiscardable`. A pair still
|
|
260
|
+
/// awaiting a leg is refused whatever the clock says, since one satellite has already executed.
|
|
261
|
+
/// - `block.timestamp` must be past each id's `releaseAt`; otherwise reverts with `ValidationNotReleasable`.
|
|
262
|
+
/// - A caller without the role bound to this selector needs `block.timestamp` past each id's second window;
|
|
263
|
+
/// otherwise reverts with `ValidationNotPubliclyDiscardable`.
|
|
264
|
+
///
|
|
265
|
+
/// Emits `ValidationDiscarded` per id.
|
|
266
|
+
/// @param validationIds The validations to discard.
|
|
267
|
+
function discardExpiredValidations(uint256[] calldata validationIds) external;
|
|
268
|
+
|
|
269
|
+
/// @dev Gives up on a pair of which exactly one leg ever arrived, a second reconciliation window past
|
|
270
|
+
/// `releaseAt` so a merely slow leg still reconciles late instead. The burned amount goes back to the wallet
|
|
271
|
+
/// it left, whatever is still reserved is released, and the validation ends in `Resolved`, where any leg
|
|
272
|
+
/// arriving afterwards halts the token. When it was the mint leg that landed there is nothing on this chain
|
|
273
|
+
/// to return, so the chain that owes the burn is paused for issuance instead.
|
|
274
|
+
///
|
|
275
|
+
/// Requirements:
|
|
276
|
+
/// - The caller must hold the role bound to this selector by the AccessManager.
|
|
277
|
+
/// - The validation must be awaiting its other leg; otherwise reverts with `ValidationNotStuck`.
|
|
278
|
+
/// - `block.timestamp` must be past the second window; otherwise reverts with `ValidationNotYetResolvable`.
|
|
279
|
+
///
|
|
280
|
+
/// Emits `ValidationResolved`.
|
|
281
|
+
function resolveStuckValidation(uint256 validationId) external;
|
|
282
|
+
|
|
283
|
+
/// @dev The window added to the issuance timestamp to compute `expiry`. Zero until set, which blocks issuance.
|
|
284
|
+
function defaultValidityWindow() external view returns (uint64);
|
|
285
|
+
|
|
286
|
+
/// @dev The reconciliation window configured for `chainKey`, zero when unset, which blocks issuance.
|
|
287
|
+
/// @param chainKey The chain to look up.
|
|
288
|
+
function reconciliationWindowOf(bytes32 chainKey) external view returns (uint64);
|
|
289
|
+
|
|
290
|
+
/// @dev Whether issuance is paused for movements involving `chainKey`.
|
|
291
|
+
/// @param chainKey The chain to look up.
|
|
292
|
+
function isIssuancePaused(bytes32 chainKey) external view returns (bool);
|
|
293
|
+
|
|
294
|
+
/// @dev The last validation id issued; ids start at 1 and increase by one, so zero is never a valid id.
|
|
295
|
+
function lastValidationId() external view returns (uint256);
|
|
296
|
+
|
|
297
|
+
/// @dev Everything kept for `validationId`, all zeros when the id was never issued.
|
|
298
|
+
/// @param validationId The validation to look up.
|
|
299
|
+
function validationOf(uint256 validationId) external view returns (Validation memory);
|
|
300
|
+
|
|
301
|
+
/// @dev Where `validationId` stands: the stored status, or `Expired` for a stored `Pending` past `releaseAt`.
|
|
302
|
+
///
|
|
303
|
+
/// Requirements:
|
|
304
|
+
/// - `validationId` must have been issued; otherwise reverts with `UnknownValidation`.
|
|
305
|
+
/// @param validationId The validation to look up.
|
|
306
|
+
function statusOf(uint256 validationId) external view returns (ValidationStatus);
|
|
307
|
+
|
|
308
|
+
}
|