@t-rex-network/onchainid 0.0.0-stage → 3.0.0-beta2
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/LICENSE.md +674 -0
- package/NOTICE.md +66 -0
- package/README.md +177 -2
- package/contracts/Identity.sol +235 -0
- package/contracts/IdentityUtilities.sol +269 -0
- package/contracts/KeyManager.sol +193 -0
- package/contracts/SmartAccount.sol +222 -0
- package/contracts/factory/IIdentityFactory.sol +325 -0
- package/contracts/factory/IdentityFactory.sol +818 -0
- package/contracts/interface/IClaimIssuer.sol +105 -0
- package/contracts/interface/IERC734.sol +69 -0
- package/contracts/interface/IERC735.sol +149 -0
- package/contracts/interface/IIdentity.sol +63 -0
- package/contracts/interface/IIdentityUtilities.sol +135 -0
- package/contracts/interface/IKeyExecutor.sol +84 -0
- package/contracts/libraries/Errors.sol +407 -0
- package/contracts/libraries/FormatResolver.sol +74 -0
- package/contracts/libraries/Hashing.sol +35 -0
- package/contracts/libraries/IdentityTypes.sol +53 -0
- package/contracts/libraries/KeyPurposes.sol +49 -0
- package/contracts/libraries/KeyTypes.sol +46 -0
- package/contracts/modules/claims/EASClaimIssuer.sol +348 -0
- package/contracts/modules/executors/KeyApprovalModule.sol +313 -0
- package/contracts/modules/executors/RecoveryModule.sol +88 -0
- package/contracts/modules/validators/ERC734Validator.sol +1000 -0
- package/contracts/modules/validators/ERC7579Validator.sol +74 -0
- package/contracts/proxy/IdentityUtilitiesProxy.sol +36 -0
- package/contracts/reputation/IReputationRegistry.sol +117 -0
- package/contracts/reputation/ReputationRegistry.sol +155 -0
- package/contracts/storage/Structs.sol +176 -0
- package/contracts/vendor/eas/IEAS.sol +36 -0
- package/contracts/vendor/utils/SafeCalldataBatch.sol +61 -0
- package/out/AbstractSigner.sol/AbstractSigner.json +1 -0
- package/out/AccessControlUpgradeable.sol/AccessControlUpgradeable.json +1 -0
- package/out/AccessManaged.sol/AccessManaged.json +1 -0
- package/out/AccessManager.sol/AccessManager.json +1 -0
- package/out/Account.sol/Account.json +1 -0
- package/out/AddClaimByTrustedIssuer.t.sol/AddClaimAsTrustedIssuerTest.json +1 -0
- package/out/Address.sol/Address.json +1 -0
- package/out/Arrays.sol/Arrays.json +1 -0
- package/out/AuthorityUtils.sol/AuthorityUtils.json +1 -0
- package/out/Base.sol/CommonBase.json +1 -0
- package/out/Base.sol/ScriptBase.json +1 -0
- package/out/Base.sol/TestBase.json +1 -0
- package/out/Base64.sol/Base64.json +1 -0
- package/out/BatchDecodeParity.t.sol/BatchDecodeParityTest.json +1 -0
- package/out/BeaconProxy.sol/BeaconProxy.json +1 -0
- package/out/Bytes.sol/Bytes.json +1 -0
- package/out/Calldata.sol/Calldata.json +1 -0
- package/out/ClaimSignatureDefinition.t.sol/ClaimSignatureDefinitionTest.json +1 -0
- package/out/ClaimSignatureDefinition.t.sol/NoERC1271Delegate.json +1 -0
- package/out/ClaimSignatureDefinition.t.sol/PickyERC1271Delegate.json +1 -0
- package/out/ClaimSignerHelper.sol/ClaimSignerHelper.json +1 -0
- package/out/ClaimTo.t.sol/ClaimToTest.json +1 -0
- package/out/Claims.t.sol/ClaimsTest.json +1 -0
- package/out/Claims.t.sol/ExternalIssuer.json +1 -0
- package/out/Comparators.sol/Comparators.json +1 -0
- package/out/Constants.sol/Constants.json +1 -0
- package/out/Context.sol/Context.json +1 -0
- package/out/ContextUpgradeable.sol/ContextUpgradeable.json +1 -0
- package/out/Create2.sol/Create2.json +1 -0
- package/out/Create3.sol/Create3.json +1 -0
- package/out/DeployOnchainID.s.sol/DeployOnchainID.json +1 -0
- package/out/EASClaimIssuer.sol/EASClaimIssuer.json +1 -0
- package/out/EASClaimIssuer.t.sol/EASClaimIssuerTest.json +1 -0
- package/out/EASClaimIssuer.t.sol/VmContractHelper29562166e1daff82a9ba4e08c324c14e885cfef135c42b5774ced18642e5fa19.json +1 -0
- package/out/EASTypes.sol/IEASTest.json +1 -0
- package/out/EASTypes.sol/ISchemaRegistryTest.json +1 -0
- package/out/ECDSA.sol/ECDSA.json +1 -0
- package/out/EIP712.sol/EIP712.json +1 -0
- package/out/ERC165.sol/ERC165.json +1 -0
- package/out/ERC165Upgradeable.sol/ERC165Upgradeable.json +1 -0
- package/out/ERC1967Proxy.sol/ERC1967Proxy.json +1 -0
- package/out/ERC1967Utils.sol/ERC1967Utils.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/ERC734Validator.t.sol/ERC734ValidatorTest.json +1 -0
- package/out/ERC734Validator.t.sol/PocCounter.json +1 -0
- package/out/ERC734Validator.t.sol/VmContractHelper7beb488c9b6c5f9f79178a8ce1e9ea8b7d447a9f1b366d4a3784214e9066b776.json +1 -0
- package/out/ERC7579DelayedExecutor.sol/ERC7579DelayedExecutor.json +1 -0
- package/out/ERC7579Executor.sol/ERC7579Executor.json +1 -0
- package/out/ERC7579Multisig.sol/ERC7579Multisig.json +1 -0
- package/out/ERC7579MultisigWeighted.sol/ERC7579MultisigWeighted.json +1 -0
- package/out/ERC7579SocialRecoveryExecutor.sol/ERC7579SocialRecoveryExecutor.json +1 -0
- package/out/ERC7579Validator.sol/ERC7579Validator.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 -0
- package/out/Errors.sol/Errors.json +1 -0
- package/out/Executions.t.sol/ETHReceiver.json +1 -0
- package/out/Executions.t.sol/ExecutionsTest.json +1 -0
- package/out/Executions.t.sol/RevertingReceiver.json +1 -0
- package/out/FormatResolver.sol/FormatResolver.json +1 -0
- package/out/Hashes.sol/Hashes.json +1 -0
- package/out/IAccessControl.sol/IAccessControl.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 -0
- package/out/IClaimIssuer.sol/IClaimIssuer.json +1 -0
- package/out/IEAS.sol/IEAS.json +1 -0
- package/out/IERC1271.sol/IERC1271.json +1 -0
- package/out/IERC165.sol/IERC165.json +1 -0
- package/out/IERC1967.sol/IERC1967.json +1 -0
- 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 -0
- package/out/IERC734.sol/IERC734.json +1 -0
- package/out/IERC734Surface.t.sol/IERC734SurfaceTest.json +1 -0
- package/out/IERC735.sol/IERC735.json +1 -0
- package/out/IERC7913.sol/IERC7913SignatureVerifier.json +1 -0
- package/out/IIdentity.sol/IIdentity.json +1 -0
- package/out/IIdentityFactory.sol/IIdentityFactory.json +1 -0
- package/out/IIdentityUtilities.sol/IIdentityUtilities.json +1 -0
- package/out/IKeyExecutor.sol/IKeyExecutor.json +1 -0
- package/out/IMulticall3.sol/IMulticall3.json +1 -0
- package/out/IReputationRegistry.sol/IReputationRegistry.json +1 -0
- package/out/Identity.sol/Identity.json +1 -0
- package/out/IdentityFactory.sol/IdentityFactory.json +1 -0
- package/out/IdentityFactory.t.sol/IdentityFactoryTest.json +1 -0
- package/out/IdentityFactory.t.sol/VmContractHelper28a7b3ffc37fea8b5c41ecc8f253eb5ab470e21bb0401440d9a55fcb4f8afe5c.json +1 -0
- package/out/IdentityHelper.sol/IdentityHelper.json +1 -0
- package/out/IdentityHelper.sol/VmContractHelper78387a8fc41a64804f1f0fc2cbba310bbca11e4f057b06dfa169d4c103c08be5.json +1 -0
- package/out/IdentityTypes.sol/IdentityTypes.json +1 -0
- package/out/IdentityUtilities.sol/IdentityUtilities.json +1 -0
- package/out/IdentityUtilities.t.sol/IdentityUtilitiesTest.json +1 -0
- package/out/IdentityUtilities.t.sol/VmContractHelper7ed074704942d210565581d7e79e91a1d3425a5a7e758acb90866c42420e726c.json +1 -0
- package/out/IdentityUtilitiesProxy.sol/IdentityUtilitiesProxy.json +1 -0
- package/out/Init.t.sol/InitTest.json +1 -0
- package/out/Init.t.sol/VmContractHelper95bc81f417f4a3acb58eafba49b7834c5e65588c78654308ee428eb7d9276cce.json +1 -0
- package/out/Initializable.sol/Initializable.json +1 -0
- package/out/InteroperableAddressEncoding.t.sol/InteroperableAddressEncodingTest.json +1 -0
- package/out/KeyApprovalModule.sol/IIdentityAccount.json +1 -0
- package/out/KeyApprovalModule.sol/KeyApprovalModule.json +1 -0
- package/out/KeyApprovalModuleFactoryGuard.t.sol/KeyApprovalModuleFactoryGuardTest.json +1 -0
- package/out/KeyManager.sol/KeyManager.json +1 -0
- package/out/KeyPurposes.sol/KeyPurposes.json +1 -0
- package/out/KeyTypes.sol/KeyTypes.json +1 -0
- package/out/Keys.t.sol/KeysTest.json +1 -0
- package/out/LowLevelCall.sol/LowLevelCall.json +1 -0
- package/out/Math.sol/Math.json +1 -0
- package/out/MessageHashUtils.sol/MessageHashUtils.json +1 -0
- package/out/MockERC1271Signer.sol/MockERC1271Signer.json +1 -0
- package/out/MockERC1271Wallet.sol/MockERC1271Wallet.json +1 -0
- package/out/MockERC7786Gateway.sol/MockERC7786Gateway.json +1 -0
- package/out/MockERC7913PermissiveVerifier.sol/MockERC7913PermissiveVerifier.json +1 -0
- package/out/MockLyingERC734Getter.sol/MockLyingERC734Getter.json +1 -0
- package/out/MockStockECDSAValidator.sol/MockStockECDSAValidator.json +1 -0
- package/out/Multicall.sol/Multicall.json +1 -0
- package/out/Multisig.sol/Multisig.json +1 -0
- package/out/Nonces.sol/Nonces.json +1 -0
- package/out/OnchainIDSetup.sol/OnchainIDSetup.json +1 -0
- package/out/Ownable.sol/Ownable.json +1 -0
- package/out/P256.sol/P256.json +1 -0
- package/out/Packing.sol/Packing.json +1 -0
- package/out/Panic.sol/Panic.json +1 -0
- package/out/PrivilegedReentryGuard.t.sol/PocCounter.json +1 -0
- package/out/PrivilegedReentryGuard.t.sol/PrivilegedReentryGuardTest.json +1 -0
- package/out/Proxy.sol/Proxy.json +1 -0
- package/out/Proxy.t.sol/ProxyTest.json +1 -0
- package/out/Proxy.t.sol/VmContractHelper20ec29ce959b555228240226871c123d935ae49f617ce49540ee53c85f9f8cd4.json +1 -0
- package/out/ProxyPattern.t.sol/ProxyPatternTest.json +1 -0
- package/out/RecoveryModule.sol/RecoveryModule.json +1 -0
- package/out/RecoveryModule.t.sol/RecoveryModuleTest.json +1 -0
- package/out/RecoveryModule.t.sol/VmContractHelper84563bc19cefad0d2824def84f4cab79093d389b1866eff467a2908e14dd8421.json +1 -0
- package/out/ReputationRegistry.sol/ReputationRegistry.json +1 -0
- package/out/ReputationRegistry.t.sol/FakeIdentity.json +1 -0
- package/out/ReputationRegistry.t.sol/ReputationRegistryTest.json +1 -0
- package/out/ReputationRegistry.t.sol/VmContractHelper4353cedc5e63171396a0756138ec48ebba489252c7f4fef50b08f9e2c0989ec9.json +1 -0
- package/out/RevertingIdentity.sol/RevertingIdentity.json +1 -0
- package/out/SafeCalldataBatch.sol/SafeCalldataBatch.json +1 -0
- package/out/SafeCast.sol/SafeCast.json +1 -0
- package/out/Script.sol/Script.json +1 -0
- package/out/ShortStrings.sol/ShortStrings.json +1 -0
- package/out/SignatureChecker.sol/SignatureChecker.json +1 -0
- package/out/SignedMath.sol/SignedMath.json +1 -0
- package/out/SlotDerivation.sol/SlotDerivation.json +1 -0
- package/out/SmartAccount.sol/SmartAccount.json +1 -0
- package/out/SmartAccount.t.sol/AlwaysApprovePolicy.json +1 -0
- package/out/SmartAccount.t.sol/Counter.json +1 -0
- package/out/SmartAccount.t.sol/IAddKeyWithData.json +1 -0
- package/out/SmartAccount.t.sol/ReentrantUninstaller.json +1 -0
- package/out/SmartAccount.t.sol/SmartAccountTest.json +1 -0
- package/out/SmartAccount.t.sol/TestExecutor.json +1 -0
- package/out/StdAssertions.sol/StdAssertions.json +1 -0
- package/out/StdChains.sol/StdChains.json +1 -0
- package/out/StdCheats.sol/StdCheats.json +1 -0
- package/out/StdCheats.sol/StdCheatsSafe.json +1 -0
- package/out/StdConstants.sol/StdConstants.json +1 -0
- package/out/StdError.sol/stdError.json +1 -0
- package/out/StdInvariant.sol/StdInvariant.json +1 -0
- package/out/StdJson.sol/stdJson.json +1 -0
- package/out/StdMath.sol/stdMath.json +1 -0
- package/out/StdStorage.sol/stdStorage.json +1 -0
- package/out/StdStorage.sol/stdStorageSafe.json +1 -0
- package/out/StdStyle.sol/StdStyle.json +1 -0
- package/out/StdToml.sol/stdToml.json +1 -0
- package/out/StdUtils.sol/StdUtils.json +1 -0
- package/out/StorageSlot.sol/StorageSlot.json +1 -0
- package/out/Strings.sol/Strings.json +1 -0
- package/out/Structs.sol/Structs.json +1 -0
- package/out/Test.sol/Test.json +1 -0
- package/out/TestIdentityUtilities.sol/TestIdentityUtilities.json +1 -0
- package/out/Time.sol/Time.json +1 -0
- package/out/TokenOid.t.sol/TokenOidTest.json +1 -0
- package/out/UUPSUpgradeable.sol/UUPSUpgradeable.json +1 -0
- package/out/UnlockedIdentity.sol/UnlockedIdentity.json +1 -0
- package/out/UpgradeableBeacon.sol/UpgradeableBeacon.json +1 -0
- package/out/VersionUpgrade.t.sol/VersionUpgradeTest.json +1 -0
- package/out/Vm.sol/Vm.json +1 -0
- package/out/Vm.sol/VmSafe.json +1 -0
- package/out/WebAuthn.sol/WebAuthn.json +1 -0
- package/out/WebAuthn.t.sol/WebAuthnTest.json +1 -0
- package/out/build-info/1056f64abc9637ee.json +1 -0
- package/out/console.sol/console.json +1 -0
- 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 -0
- 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/safeconsole.sol/safeconsole.json +1 -0
- package/out/src/Test.sol/Test.json +1 -0
- package/out/utils/Errors.sol/Errors.json +1 -0
- package/package.json +75 -4
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
2
|
+
//
|
|
3
|
+
// ONCHAINID Smart Contracts
|
|
4
|
+
// Digital identities for the T-REX ecosystem.
|
|
5
|
+
//
|
|
6
|
+
// Copyright (C) 2026 Digital Asset Operational Services ISAC Ltd. ("T-REX Network")
|
|
7
|
+
//
|
|
8
|
+
// This file is part of the ONCHAINID smart contract suite.
|
|
9
|
+
//
|
|
10
|
+
// This program is free software: you can redistribute it and/or modify
|
|
11
|
+
// it under the terms of the GNU General Public License as published by
|
|
12
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
13
|
+
// (at your option) any later version.
|
|
14
|
+
//
|
|
15
|
+
// This program is distributed in the hope that it will be useful,
|
|
16
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18
|
+
// GNU General Public License for more details.
|
|
19
|
+
//
|
|
20
|
+
// You should have received a copy of the GNU General Public License
|
|
21
|
+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
22
|
+
|
|
23
|
+
pragma solidity ^0.8.28;
|
|
24
|
+
|
|
25
|
+
import {
|
|
26
|
+
ERC7579SocialRecoveryExecutor
|
|
27
|
+
} from "@openzeppelin/accounts/modules/executors/ERC7579SocialRecoveryExecutor.sol";
|
|
28
|
+
|
|
29
|
+
/// @title RecoveryModule
|
|
30
|
+
/// @notice Social recovery for ONCHAINID identities. Wraps OZ's
|
|
31
|
+
/// {ERC7579SocialRecoveryExecutor} (vendored via soldeer from
|
|
32
|
+
/// OpenZeppelin/openzeppelin-accounts, commit e4c2a32a). All logic lives
|
|
33
|
+
/// upstream, we add nothing.
|
|
34
|
+
///
|
|
35
|
+
/// @dev Why a wrapper file when there is no body.
|
|
36
|
+
/// The upstream contract is marked `abstract`, so we can't deploy it
|
|
37
|
+
/// directly. Inheriting it once gives us a concrete contract we can
|
|
38
|
+
/// instantiate with `new RecoveryModule()`, a stable name to reference
|
|
39
|
+
/// from scripts and tests, and a place to override later if we ever need
|
|
40
|
+
/// to (we don't today).
|
|
41
|
+
///
|
|
42
|
+
/// @dev Why OZ instead of writing our own.
|
|
43
|
+
/// The recovery flow holds authority that can replace MANAGEMENT keys, so
|
|
44
|
+
/// writing our own means owning the audit. OZ already built the M-of-N +
|
|
45
|
+
/// delay + cancel design we want and pointed us at this file. We pin to
|
|
46
|
+
/// a commit so an upstream change can't surprise us. The upstream repo
|
|
47
|
+
/// is private and not audited yet; bump the pin once OZ tags an audited
|
|
48
|
+
/// release.
|
|
49
|
+
///
|
|
50
|
+
/// @dev How an account uses it.
|
|
51
|
+
/// A MANAGEMENT key holder installs this as an ERC-7579 executor module
|
|
52
|
+
/// and registers the module address in {KeyManager} with the MANAGEMENT
|
|
53
|
+
/// purpose. That second step is the ONCHAINID-specific bit: without it,
|
|
54
|
+
/// {SmartAccount} would reject the self-targeted `addKey` call the
|
|
55
|
+
/// module dispatches at execution time. Same pattern KeyApprovalModule
|
|
56
|
+
/// uses.
|
|
57
|
+
///
|
|
58
|
+
/// Install data is OZ's length-prefixed format documented on
|
|
59
|
+
/// `ERC7579SocialRecoveryExecutor.onInstall`:
|
|
60
|
+
/// [uint16(execLen), execArgs, uint16(msigLen), msigArgs]
|
|
61
|
+
/// where:
|
|
62
|
+
/// execArgs = abi.encodePacked(uint32 delay, uint32 expiration)
|
|
63
|
+
/// msigArgs = abi.encode(bytes[] guardians, uint64 threshold, uint64[] weights)
|
|
64
|
+
///
|
|
65
|
+
/// @dev How the identity cancels and reconfigures.
|
|
66
|
+
/// The owner path of `cancelRecovery` and the setters for guardians,
|
|
67
|
+
/// threshold, weights, delay and expiration only accept the account
|
|
68
|
+
/// as caller. To reach them, the account calls `execute` on itself
|
|
69
|
+
/// with an inner `execute` that targets this module. The outer call
|
|
70
|
+
/// needs MANAGEMENT like any self-targeted execution, and the inner
|
|
71
|
+
/// call is allowed because {SmartAccount} lets the account call its
|
|
72
|
+
/// own modules. Guardians keep their own quorum-signed
|
|
73
|
+
/// `cancelRecovery` path.
|
|
74
|
+
///
|
|
75
|
+
/// @dev What recovery actually does.
|
|
76
|
+
/// `executeRecovery` dispatches whatever ERC-7579 execution the guardians
|
|
77
|
+
/// signed. The canonical recovery payload is a self-targeted
|
|
78
|
+
/// `addKeyWithData(newKey, MANAGEMENT, ECDSA, ...)`, which installs a
|
|
79
|
+
/// fresh MANAGEMENT key on the identity. The integration tests in
|
|
80
|
+
/// test/modules/recovery/RecoveryModule.t.sol exercise that round-trip
|
|
81
|
+
/// and show the recovered key works the same as the original for every
|
|
82
|
+
/// MANAGEMENT-gated operation.
|
|
83
|
+
///
|
|
84
|
+
/// @dev Why this works with our Identity.
|
|
85
|
+
/// OZ's module scopes signatures to the account's EIP-712 domain by
|
|
86
|
+
/// calling `IERC5267(account).eip712Domain()`. {Identity} inherits OZ's
|
|
87
|
+
/// {EIP712}, which exposes that interface. Nothing extra to wire.
|
|
88
|
+
contract RecoveryModule is ERC7579SocialRecoveryExecutor { }
|