@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
|
@@ -0,0 +1,180 @@
|
|
|
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
|
+
|
|
60
|
+
pragma solidity ^0.8.30;
|
|
61
|
+
|
|
62
|
+
import { IIdentityFactory } from "@onchain-id/solidity/contracts/factory/IIdentityFactory.sol";
|
|
63
|
+
import { IIdentity } from "@onchain-id/solidity/contracts/interface/IIdentity.sol";
|
|
64
|
+
|
|
65
|
+
import { IERC3643ClaimTopicsRegistry } from "../../ERC-3643/IERC3643ClaimTopicsRegistry.sol";
|
|
66
|
+
import { IERC3643IdentityRegistry } from "../../ERC-3643/IERC3643IdentityRegistry.sol";
|
|
67
|
+
import { IERC3643TrustedIssuersRegistry } from "../../ERC-3643/IERC3643TrustedIssuersRegistry.sol";
|
|
68
|
+
|
|
69
|
+
interface ITREXRegistry is IERC3643IdentityRegistry, IERC3643TrustedIssuersRegistry, IERC3643ClaimTopicsRegistry {
|
|
70
|
+
|
|
71
|
+
/// @dev Disables the eligibility checks for token transfers and other operations.
|
|
72
|
+
///
|
|
73
|
+
/// Once disabled, `isVerified` skips the required-claims and trusted-issuer verification. A wallet
|
|
74
|
+
/// still needs an active identity: one that is unbound or revoked is refused in every mode. Unlike 4.2,
|
|
75
|
+
/// disabling the checks does not verify every address, so every holder of an open-mode token needs an
|
|
76
|
+
/// ONCHAINID, contracts that hold tokens (pools, escrows, vaults) included. The agent registers them
|
|
77
|
+
/// like any investor.
|
|
78
|
+
///
|
|
79
|
+
/// Requirements:
|
|
80
|
+
/// - The caller must hold the role bound to this selector by the AccessManager.
|
|
81
|
+
/// - The eligibility checks must not already be disabled; otherwise the call reverts with
|
|
82
|
+
/// `EligibilityChecksDisabledAlready`.
|
|
83
|
+
///
|
|
84
|
+
/// Emits an `EligibilityChecksDisabled` event upon successful execution.
|
|
85
|
+
function disableEligibilityChecks() external;
|
|
86
|
+
|
|
87
|
+
/// @dev Enables the eligibility checks for token transfers and other operations.
|
|
88
|
+
///
|
|
89
|
+
/// Resumes the full claims / trusted-issuer verification inside `isVerified`.
|
|
90
|
+
///
|
|
91
|
+
/// Requirements:
|
|
92
|
+
/// - The caller must hold the role bound to this selector by the AccessManager.
|
|
93
|
+
/// - The eligibility checks must currently be disabled; otherwise the call reverts with
|
|
94
|
+
/// `EligibilityChecksEnabledAlready`.
|
|
95
|
+
///
|
|
96
|
+
/// Emits an `EligibilityChecksEnabled` event upon successful execution.
|
|
97
|
+
function enableEligibilityChecks() external;
|
|
98
|
+
|
|
99
|
+
/// @dev Returns the ONCHAINID IdentityFactory this registry resolves through: a wallet the storage does
|
|
100
|
+
/// not bind resolves here, and its type record backs per-type claim topic resolution. Baked into the
|
|
101
|
+
/// implementation at construction, so changing it takes a new implementation published through the beacon.
|
|
102
|
+
/// `identityTypeOf` on it returns 0 for identities it did not mint, which resolve to the default claim topics.
|
|
103
|
+
function identityFactory() external view returns (IIdentityFactory);
|
|
104
|
+
|
|
105
|
+
/// @dev Adds a claim topic to the override set of an identity type.
|
|
106
|
+
///
|
|
107
|
+
/// A non-empty override set fully REPLACES the default claim topics inside `isVerified` for
|
|
108
|
+
/// identities of that type. It is not additive. Later changes to the default topics do not reach
|
|
109
|
+
/// types holding an override; a topic meant for everyone must be added to each override too.
|
|
110
|
+
///
|
|
111
|
+
/// The identity type checked by `isVerified` is the IdentityFactory record (`identityTypeOf`),
|
|
112
|
+
/// never what the identity contract says about itself.
|
|
113
|
+
///
|
|
114
|
+
/// Requirements:
|
|
115
|
+
/// - The caller must hold the role bound to this selector by the AccessManager.
|
|
116
|
+
/// - `identityType` must not be 0 (reserved for "unknown", which always resolves to the default
|
|
117
|
+
/// topics); otherwise the call reverts with `InvalidIdentityType`.
|
|
118
|
+
/// - The override set must hold fewer than 15 topics; otherwise the call reverts with
|
|
119
|
+
/// `MaxClaimTopicsReached`.
|
|
120
|
+
/// - The topic must not already be in the set; otherwise the call reverts with
|
|
121
|
+
/// `ClaimTopicAlreadyExists`.
|
|
122
|
+
///
|
|
123
|
+
/// Emits a `ClaimTopicAddedForIdentityType` event upon successful execution.
|
|
124
|
+
/// @param identityType the ONCHAINID identity type the topic is required for
|
|
125
|
+
/// @param claimTopic the claim topic to require for that identity type
|
|
126
|
+
function addClaimTopicForIdentityType(uint256 identityType, uint256 claimTopic) external;
|
|
127
|
+
|
|
128
|
+
/// @dev Removes a claim topic from the override set of an identity type.
|
|
129
|
+
///
|
|
130
|
+
/// Once the set becomes empty, identities of that type fall back to the default claim topics.
|
|
131
|
+
/// Removing a topic that is not in the set is a silent no-op, mirroring `removeClaimTopic`.
|
|
132
|
+
///
|
|
133
|
+
/// Requirements:
|
|
134
|
+
/// - The caller must hold the role bound to this selector by the AccessManager.
|
|
135
|
+
/// - `identityType` must not be 0; otherwise the call reverts with `InvalidIdentityType`.
|
|
136
|
+
///
|
|
137
|
+
/// Emits a `ClaimTopicRemovedForIdentityType` event when a topic is actually removed.
|
|
138
|
+
/// @param identityType the ONCHAINID identity type the topic is no longer required for
|
|
139
|
+
/// @param claimTopic the claim topic to remove for that identity type
|
|
140
|
+
function removeClaimTopicForIdentityType(uint256 identityType, uint256 claimTopic) external;
|
|
141
|
+
|
|
142
|
+
/// @dev Returns the identity an ERC-7930 wallet is bound to, for attribution.
|
|
143
|
+
///
|
|
144
|
+
/// A wallet on this chain reads its registry entry; every other wallet is resolved through the
|
|
145
|
+
/// IdentityFactory, revoked bindings included, so a position stays attributed once its wallet is
|
|
146
|
+
/// revoked. This is the lookup for who owns a position; use `isWalletVerified` to know whether the
|
|
147
|
+
/// wallet may receive new activity.
|
|
148
|
+
///
|
|
149
|
+
/// Requirements:
|
|
150
|
+
/// - `wallet` must be a canonical ERC-7930 v1 envelope; otherwise reverts with
|
|
151
|
+
/// `NonCanonicalInteroperableAddress`.
|
|
152
|
+
/// @param wallet the ERC-7930 envelope of the wallet to resolve
|
|
153
|
+
/// @return the bound identity, or the zero address when the wallet is unbound
|
|
154
|
+
function resolveIdentity(bytes calldata wallet) external view returns (IIdentity);
|
|
155
|
+
|
|
156
|
+
/// @dev Returns whether an ERC-7930 wallet is eligible for new activity, the way `isVerified`
|
|
157
|
+
/// answers for a wallet on this chain.
|
|
158
|
+
///
|
|
159
|
+
/// A wallet on this chain reads its registry entry; every other wallet resolves its active binding
|
|
160
|
+
/// through the IdentityFactory. A wallet the IdentityFactory has revoked is not eligible on either
|
|
161
|
+
/// path, however it was registered, even though `resolveIdentity` still attributes it. The identity
|
|
162
|
+
/// then passes the same claim check as `isVerified`, and `disableEligibilityChecks` skips that check
|
|
163
|
+
/// the same way, still requiring the active identity.
|
|
164
|
+
///
|
|
165
|
+
/// Requirements:
|
|
166
|
+
/// - `wallet` must be a canonical ERC-7930 v1 envelope; otherwise reverts with
|
|
167
|
+
/// `NonCanonicalInteroperableAddress`.
|
|
168
|
+
/// @param wallet the ERC-7930 envelope of the wallet to check
|
|
169
|
+
/// @return true when the wallet's active identity satisfies every required claim topic
|
|
170
|
+
function isWalletVerified(bytes calldata wallet) external view returns (bool);
|
|
171
|
+
|
|
172
|
+
/// @dev Returns the override claim topics registered for an identity type.
|
|
173
|
+
///
|
|
174
|
+
/// An empty array means identities of that type verify against the default `getClaimTopics()`.
|
|
175
|
+
/// @param identityType the ONCHAINID identity type to query
|
|
176
|
+
function getClaimTopicsForIdentityType(uint256 identityType) external view returns (uint256[] memory);
|
|
177
|
+
/// @notice Returns true when the wallet is active in this registry's storage, ignoring the IdentityFactory.
|
|
178
|
+
function isLocallyRegistered(address userAddress) external view returns (bool);
|
|
179
|
+
|
|
180
|
+
}
|
|
@@ -37,61 +37,222 @@
|
|
|
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
|
import { IERC3643 } from "../ERC-3643/IERC3643.sol";
|
|
67
|
-
import {
|
|
63
|
+
import { TokenLedgerLib } from "./TokenLedgerLib.sol";
|
|
68
64
|
|
|
65
|
+
/// @title IToken
|
|
66
|
+
/// @notice The T-REX token surface beyond ERC-3643: the ledger views the standard does not define.
|
|
67
|
+
/// A position has three buckets. Free and frozen are native and `balanceOf` is their sum, plain ERC-20.
|
|
68
|
+
/// Bridged is the part delegated to satellites, per ERC-7930 wallet, outside `balanceOf`; `totalSupply` counts
|
|
69
|
+
/// all three. Inside the bridged bucket, an amount a satellite burned for a cross-chain validation whose mint
|
|
70
|
+
/// leg has not landed is held in transit against that validation: no wallet holds it, its sender still owns it.
|
|
69
71
|
interface IToken is IERC3643 {
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
73
|
+
event ReservedForValidation(bytes32 indexed walletKey, bytes wallet, uint256 amount);
|
|
74
|
+
event ReleasedFromValidation(bytes32 indexed walletKey, bytes wallet, uint256 amount);
|
|
75
|
+
event ReturnedInTransit(bytes32 indexed walletKey, uint256 indexed validationId, bytes wallet, uint256 amount);
|
|
76
|
+
event HeldInTransit(bytes32 indexed fromKey, uint256 indexed validationId, bytes fromWallet, uint256 amount);
|
|
77
|
+
event BridgedTransfer(
|
|
78
|
+
bytes32 indexed fromKey,
|
|
79
|
+
bytes32 indexed toKey,
|
|
80
|
+
uint256 indexed validationId,
|
|
81
|
+
bytes from,
|
|
82
|
+
bytes to,
|
|
83
|
+
uint256 amount
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
event DelegatedOut(
|
|
87
|
+
address indexed holder, bytes32 indexed toKey, uint256 indexed delegationId, bytes toWallet, uint256 amount
|
|
88
|
+
);
|
|
89
|
+
event RecallInstructed(
|
|
90
|
+
uint256 indexed recallId, bytes32 indexed walletKey, address indexed nativeWallet, bytes wallet, uint256 amount
|
|
91
|
+
);
|
|
92
|
+
event RecallSettled(uint256 indexed recallId, bytes32 indexed originChainKey, uint256 amount);
|
|
93
|
+
event BurnProofDuplicate(uint256 indexed recallId, bytes32 indexed originChainKey);
|
|
94
|
+
event ReplayedBurnProof(uint256 indexed recallId, bytes32 indexed originChainKey);
|
|
95
|
+
event InstructionResent(uint8 indexed kind, uint256 indexed id, bytes32 indexed chainKey, bytes32 sendId);
|
|
96
|
+
|
|
97
|
+
error InsufficientBridgedBalance(bytes wallet, uint256 balance, uint256 needed);
|
|
98
|
+
error WalletsNotLinked(address nativeWallet, bytes wallet);
|
|
99
|
+
error RecallMismatch(uint256 recallId);
|
|
100
|
+
error RecallAmountExceeded(uint256 recallId, uint256 instructed, uint256 proven);
|
|
101
|
+
error RecallPending(bytes32 walletKey, uint256 recallId);
|
|
102
|
+
error RecallNotPending(uint256 recallId);
|
|
103
|
+
error DelegationMismatch(uint256 delegationId);
|
|
104
|
+
error PeerChanged(bytes32 chainKey);
|
|
105
|
+
error UnknownResendKind(uint8 kind);
|
|
106
|
+
error UnverifiedWallet(bytes wallet);
|
|
107
|
+
error NonCanonicalInteroperableAddress(bytes envelope);
|
|
108
|
+
error NotASatelliteWallet(bytes wallet);
|
|
109
|
+
error NothingInTransit(uint256 validationId);
|
|
110
|
+
error TransitAlreadyHeld(uint256 validationId);
|
|
111
|
+
error TransitAmountMismatch(uint256 validationId, uint256 held, uint256 amount);
|
|
112
|
+
error NoTokenToRecover();
|
|
113
|
+
error RecoveryNotPossible();
|
|
114
|
+
error SameWalletRecovery();
|
|
115
|
+
error TokenCirculating();
|
|
116
|
+
error InvalidIdentityRegistry();
|
|
117
|
+
error InvalidCompliance();
|
|
118
|
+
error ComplianceAlreadyBoundToToken();
|
|
119
|
+
|
|
120
|
+
/// @notice Returns the part of a wallet's balance that is movable on this chain: `balanceOf` minus frozen.
|
|
121
|
+
/// @param wallet the wallet to read
|
|
122
|
+
function freeBalanceOf(address wallet) external view returns (uint256);
|
|
123
|
+
|
|
124
|
+
/// @notice Returns the position delegated to a satellite wallet.
|
|
125
|
+
/// @dev A non-canonical envelope reverts rather than reading a key no transition ever wrote.
|
|
126
|
+
/// @param wallet the ERC-7930 envelope of the satellite wallet
|
|
127
|
+
function bridgedBalanceOf(bytes calldata wallet) external view returns (uint256);
|
|
128
|
+
|
|
129
|
+
/// @notice Returns the sum of every bridged position, the in-transit holds included: the part of
|
|
130
|
+
/// `totalSupply` active on satellites. The native float, what the ERC-20 balances on this chain add up to,
|
|
131
|
+
/// is `totalSupply() - totalBridged()`.
|
|
132
|
+
function totalBridged() external view returns (uint256);
|
|
133
|
+
|
|
134
|
+
/// @notice Returns the amount held in transit against a cross-chain validation: its burn leg landed, its mint
|
|
135
|
+
/// leg has not. Zero once settled, or for a validation that never held anything.
|
|
136
|
+
/// @param validationId the validation the burn leg consumed
|
|
137
|
+
function inTransitOf(uint256 validationId) external view returns (uint256);
|
|
138
|
+
|
|
139
|
+
/// @notice Returns the sum of every in-transit hold: the part of `totalBridged` no wallet currently holds.
|
|
140
|
+
function totalInTransit() external view returns (uint256);
|
|
141
|
+
|
|
142
|
+
/// @notice Applies a settled validation to the ledger, once, by the shape of its wallets: a native `to` lands
|
|
143
|
+
/// on that holder's free balance, two satellite wallets are a bridged transfer, both under `validationId`.
|
|
144
|
+
/// `from` is always a satellite wallet, the compliance refusing to issue a validation out of a native one, so
|
|
145
|
+
/// the position a settlement debits is one the executing satellite held all along.
|
|
146
|
+
/// @dev Callable by the bound compliance only, which classified the settlement against the validation it
|
|
147
|
+
/// issued; reverts with `OnlyBoundCompliance` otherwise. Reverts with `InsufficientBridgedBalance` when
|
|
148
|
+
/// `from`'s position no longer covers `amount`, which leaves the settlement deliverable again. Reverts
|
|
149
|
+
/// with `EnforcedPause` while the token is paused, so a halt stops satellite settlements too. Bypasses
|
|
150
|
+
/// `_update`, like every ledger transition.
|
|
151
|
+
/// @param from the ERC-7930 envelope of the sender, a satellite wallet
|
|
152
|
+
/// @param to the ERC-7930 envelope of the recipient
|
|
153
|
+
/// @param amount the exact amount the satellite executed
|
|
154
|
+
/// @param validationId the validation the settlement consumed
|
|
155
|
+
function settleValidation(bytes calldata from, bytes calldata to, uint256 amount, uint256 validationId) external;
|
|
156
|
+
|
|
157
|
+
/// @notice Debits `amount` from `from`'s bridged position and holds it in transit against `validationId`:
|
|
158
|
+
/// the burn leg of a cross-chain validation landed and proves the satellite burned it, so the wallet must
|
|
159
|
+
/// not be issued or recalled against it while the mint leg is in flight. `totalBridged` and `totalSupply`
|
|
160
|
+
/// do not move; the amount is still bridged and still the sender's. `settleValidation` for the same id
|
|
161
|
+
/// later credits the recipient from the hold instead of debiting `from` again.
|
|
162
|
+
/// @dev Callable by the bound compliance only; reverts with `OnlyBoundCompliance` otherwise. Reverts with
|
|
163
|
+
/// `TransitAlreadyHeld` when the validation already holds an amount, and with `InsufficientBridgedBalance`
|
|
164
|
+
/// when `from`'s position no longer covers `amount`, which leaves the burn leg deliverable again. Reverts
|
|
165
|
+
/// with `EnforcedPause` while the token is paused.
|
|
166
|
+
/// @param from the ERC-7930 envelope of the sender, a satellite wallet
|
|
167
|
+
/// @param amount the exact amount the satellite burned
|
|
168
|
+
/// @param validationId the validation the burn leg consumed
|
|
169
|
+
function holdInTransit(bytes calldata from, uint256 amount, uint256 validationId, uint256 reserved) external;
|
|
170
|
+
|
|
171
|
+
/// @dev Puts the amount held for `validationId` back on `to`, the satellite wallet it was burned from,
|
|
172
|
+
/// because the other leg never arrived and the compliance gave up on the pair. Callable by the bound
|
|
173
|
+
/// compliance alone.
|
|
174
|
+
function returnHeldInTransit(bytes calldata to, uint256 validationId) external;
|
|
175
|
+
|
|
176
|
+
/// @dev What open validations may still draw from `wallet`. The compliance reserves this at issuance and
|
|
177
|
+
/// gives it back when the validation settles or is discarded.
|
|
178
|
+
/// @param wallet the satellite wallet, ERC-7930
|
|
179
|
+
function reservedOf(bytes calldata wallet) external view returns (uint256);
|
|
180
|
+
|
|
181
|
+
/// @dev What `wallet` can still send: its bridged balance less what open validations may draw from it.
|
|
182
|
+
/// @param wallet the satellite wallet, ERC-7930
|
|
183
|
+
function availableOf(bytes calldata wallet) external view returns (uint256);
|
|
184
|
+
|
|
185
|
+
/// @dev Reserves `amount` of `wallet`'s bridged balance for a validation being issued. Callable by the
|
|
186
|
+
/// bound compliance alone.
|
|
187
|
+
function reserveForValidation(bytes calldata wallet, uint256 amount) external;
|
|
188
|
+
|
|
189
|
+
/// @dev Gives back `amount` of what was reserved against `wallet`. Callable by the bound compliance alone.
|
|
190
|
+
function releaseFromValidation(bytes calldata wallet, uint256 amount) external;
|
|
191
|
+
|
|
192
|
+
/// @dev Initializes a token behind its beacon proxy. Called once, by the factory.
|
|
193
|
+
function init(
|
|
194
|
+
string calldata tokenName,
|
|
195
|
+
string calldata tokenSymbol,
|
|
196
|
+
uint8 tokenDecimals,
|
|
197
|
+
address identityRegistryAddress,
|
|
198
|
+
address complianceAddress,
|
|
199
|
+
address trustedGatewayRegistryAddress,
|
|
200
|
+
address onchainIdAddress,
|
|
201
|
+
address accessManagerAddress
|
|
202
|
+
) external;
|
|
203
|
+
|
|
204
|
+
/// @dev Sends a compliance validation to this token's peer on `chainKey`. Callable by the bound compliance alone.
|
|
205
|
+
function dispatchComplianceValidation(bytes32 chainKey, uint256 validationId, bytes calldata body)
|
|
206
|
+
external
|
|
207
|
+
returns (bytes32);
|
|
208
|
+
|
|
209
|
+
/// @notice Moves `amount` of `holder`'s free balance onto `toWallet`, a satellite wallet of the same identity: the
|
|
210
|
+
/// native balance is burned (`Transfer(holder, 0x0)`), the bridged position credited, `totalSupply` unchanged,
|
|
211
|
+
/// and a `MINT_INSTRUCTION` carrying a fresh delegation id sent to the Lite on `toWallet`'s chain. Location
|
|
212
|
+
/// moves, ownership does not, so no distribution rule is asked; the compliance is told, as a `DELEGATION`, so
|
|
213
|
+
/// its ledger follows a registry relink of `holder`. A lost instruction is sent again with {resend}. The way
|
|
214
|
+
/// back is a validation to a native wallet through the compliance, or an agent's {instructRecall}.
|
|
215
|
+
/// @dev Callable by `holder`, by the identity `holder` is linked to, or by an address the AccessManager authorises
|
|
216
|
+
/// for this selector; otherwise reverts with `AccessManagedUnauthorized`. Reverts with `EnforcedPause`,
|
|
217
|
+
/// `FrozenWallet`, `ZeroValue`, `WalletsNotLinked`, `UnverifiedWallet`, `NotASatelliteWallet`,
|
|
218
|
+
/// `ERC20InsufficientBalance` and `ChainNotOpen`; nothing moves in any of these cases. Emits `Transfer`,
|
|
219
|
+
/// `DelegatedOut` and `ProtocolMessageSent`.
|
|
220
|
+
/// @param holder the native wallet the tokens leave
|
|
221
|
+
/// @param toWallet the ERC-7930 envelope of the satellite wallet to credit
|
|
222
|
+
/// @param amount the amount to delegate
|
|
223
|
+
/// @return sendId the gateway's id for the instruction
|
|
224
|
+
function delegateOut(address holder, bytes calldata toWallet, uint256 amount) external returns (bytes32 sendId);
|
|
225
|
+
|
|
226
|
+
/// @notice Orders the Lite on `wallet`'s chain to burn up to `amount` of `wallet` and prove it under the returned id.
|
|
227
|
+
/// The proof debits the bridged position and credits `nativeWallet` by what the satellite actually burned. A
|
|
228
|
+
/// forced movement of location, never of ownership. One recall at a time per wallet; a lost instruction is sent
|
|
229
|
+
/// again with {resend}. Only the gateway and the peer the instruction went to may answer it, even after a
|
|
230
|
+
/// `setPeer`: before replacing a hostile peer, distrust its gateway or drain its open recalls.
|
|
231
|
+
/// @dev Callable by the AccessManager role bound to this selector. Not pause-gated: the instruction moves nothing.
|
|
232
|
+
/// Reverts with `ZeroValue`, `ZeroAddress`, `WalletsNotLinked` (revoked wallets still resolve),
|
|
233
|
+
/// `NotASatelliteWallet`, `RecallPending`, `InsufficientBridgedBalance` above the wallet's bridged position, and
|
|
234
|
+
/// `ChainNotOpen`. Reservations are not subtracted: the satellite burns what it still holds and proves that.
|
|
235
|
+
/// Emits `RecallInstructed` and `ProtocolMessageSent`.
|
|
236
|
+
/// @param wallet the ERC-7930 envelope of the satellite wallet to burn
|
|
237
|
+
/// @param amount the most the satellite may burn
|
|
238
|
+
/// @param nativeWallet the wallet on this chain to credit
|
|
239
|
+
/// @return recallId the id the burn proof must answer with
|
|
240
|
+
function instructRecall(bytes calldata wallet, uint256 amount, address nativeWallet)
|
|
241
|
+
external
|
|
242
|
+
returns (uint256 recallId);
|
|
243
|
+
|
|
244
|
+
/// @notice Sends an instruction again, byte for byte, under its original id, to the peer it first went to, through
|
|
245
|
+
/// the chain's current route. Moves nothing on this chain; the Lite acts on each id once.
|
|
246
|
+
/// `kind` 0: a delegation, `data` = `abi.encode(toWallet, amount, holder, peer)` as dispatched, checked against
|
|
247
|
+
/// the commitment stored then. `kind` 1: a recall still waiting for its proof, `data` = `abi.encode(wallet)`;
|
|
248
|
+
/// the gateway admitted to answer it becomes the current route.
|
|
249
|
+
/// @dev Callable by the AccessManager role bound to this selector, while paused too. Reverts with
|
|
250
|
+
/// `DelegationMismatch`, `RecallNotPending`, `RecallMismatch`, `PeerChanged` when the chain's peer is no longer
|
|
251
|
+
/// the one addressed, `UnknownResendKind`, and `ChainNotOpen`. Emits `ProtocolMessageSent` and `InstructionResent`.
|
|
252
|
+
/// @return sendId the gateway's id for the resent instruction
|
|
253
|
+
function resend(uint8 kind, uint256 id, bytes calldata data) external returns (bytes32 sendId);
|
|
254
|
+
|
|
255
|
+
/// @notice The recall instruction `recallId` while it waits for its proof; all zeros once settled or never issued.
|
|
256
|
+
function pendingRecall(uint256 recallId) external view returns (TokenLedgerLib.PendingRecall memory);
|
|
96
257
|
|
|
97
258
|
}
|