@t-rex-network/onchainid 0.0.0-stage → 3.0.0-beta0
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/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/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/IdentityHelper.sol/IdentityHelper.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/IdentityUtilitiesProxy.sol/IdentityUtilitiesProxy.json +1 -0
- package/out/Init.t.sol/InitTest.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/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/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/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/6d7390a9a3d29c7420710a69f614fbce.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,105 @@
|
|
|
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.27;
|
|
24
|
+
|
|
25
|
+
import { Structs } from "../storage/Structs.sol";
|
|
26
|
+
import { IIdentity } from "./IIdentity.sol";
|
|
27
|
+
|
|
28
|
+
interface IClaimIssuer is IIdentity {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @dev Reasons a claim can fail verification, in addition to `Valid`.
|
|
32
|
+
*/
|
|
33
|
+
enum ClaimStatus {
|
|
34
|
+
Valid,
|
|
35
|
+
BadSignature,
|
|
36
|
+
NotIssued,
|
|
37
|
+
Revoked,
|
|
38
|
+
NotYetValid,
|
|
39
|
+
Expired
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @dev Emitted when a claim's digest is marked spent by the issuer (revoked).
|
|
44
|
+
* The same digest may also be marked spent by `removeClaim` on the
|
|
45
|
+
* holder side; that path emits `ClaimRemoved` (see IERC735) instead.
|
|
46
|
+
*/
|
|
47
|
+
event ClaimRevoked(bytes32 indexed digest, address indexed issuer);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @dev Emitted when a claim is successfully added to an identity contract by this claim issuer.
|
|
51
|
+
*/
|
|
52
|
+
event ClaimAddedTo(address indexed identity, uint256 topic, bytes signature, Structs.ClaimData data);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @dev Mark a claim digest as spent. Canonical revocation entry point.
|
|
56
|
+
* @param digest the EIP-712 claim digest to mark spent.
|
|
57
|
+
*/
|
|
58
|
+
function revokeClaimByDigest(bytes32 digest) external;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @dev Returns true if the digest has been marked spent (revoked or removed).
|
|
62
|
+
* @param digest the EIP-712 claim digest to check.
|
|
63
|
+
*/
|
|
64
|
+
function isDigestRevoked(bytes32 digest) external view returns (bool);
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @dev Add a claim to a target identity contract. Validates that the signature is
|
|
68
|
+
* from a CLAIM_SIGNER on this issuer, that the digest is not spent, and that
|
|
69
|
+
* the time bounds in `_data` are honored before forwarding to the target.
|
|
70
|
+
*/
|
|
71
|
+
function addClaimTo(
|
|
72
|
+
uint256 _topic,
|
|
73
|
+
uint256 _scheme,
|
|
74
|
+
bytes calldata _signature,
|
|
75
|
+
Structs.ClaimData calldata _data,
|
|
76
|
+
string calldata _uri,
|
|
77
|
+
IIdentity _identity
|
|
78
|
+
) external;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @dev Checks if a claim is valid.
|
|
82
|
+
* @param _identity the identity contract related to the claim
|
|
83
|
+
* @param claimTopic the claim topic of the claim
|
|
84
|
+
* @param sig the signature of the claim
|
|
85
|
+
* @param data the structured claim data
|
|
86
|
+
* @return claimValid true if the claim is valid, false otherwise
|
|
87
|
+
*/
|
|
88
|
+
function isClaimValid(IIdentity _identity, uint256 claimTopic, bytes calldata sig, Structs.ClaimData calldata data)
|
|
89
|
+
external
|
|
90
|
+
view
|
|
91
|
+
returns (bool);
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @dev Detailed status for a claim. Distinguishes "spent" from "expired" from
|
|
95
|
+
* "bad signature", which off-chain consumers need to surface to users.
|
|
96
|
+
* @return status the detailed status (see ClaimStatus).
|
|
97
|
+
*/
|
|
98
|
+
function getClaimStatus(
|
|
99
|
+
IIdentity _identity,
|
|
100
|
+
uint256 claimTopic,
|
|
101
|
+
bytes calldata sig,
|
|
102
|
+
Structs.ClaimData calldata data
|
|
103
|
+
) external view returns (ClaimStatus status);
|
|
104
|
+
|
|
105
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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.27;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @dev Interface of the ERC734 (Key Holder) standard as defined in the EIP, registry-only.
|
|
27
|
+
*
|
|
28
|
+
* @notice The original `execute(address,uint256,bytes)` and `approve(uint256,bool)` selectors
|
|
29
|
+
* live in the {KeyApprovalModule} (an ERC-7579 fallback handler + executor). They are
|
|
30
|
+
* still reachable on every Identity at the standard ERC-734 selectors via the account's
|
|
31
|
+
* fallback, but they live behind a separate Solidity type — {IKeyExecutor} — to keep
|
|
32
|
+
* the registry interface decoupled from the execution surface.
|
|
33
|
+
*
|
|
34
|
+
* See {IKeyExecutor} for the queue ABI, and {KeyApprovalModule} for the implementation.
|
|
35
|
+
*
|
|
36
|
+
* Note on events: this interface declares none. The key registry and the execution
|
|
37
|
+
* queue are served by module singletons shared across identities, so the canonical
|
|
38
|
+
* ERC-734 events (which carry no subject) could not attribute a log to an identity.
|
|
39
|
+
* The real event ABI is the account-carrying variants — `KeyAdded` / `KeyRemoved` on
|
|
40
|
+
* {ERC734Validator} and the execution lifecycle events on {IKeyExecutor} — each with
|
|
41
|
+
* `address indexed account` (the identity) as its first field.
|
|
42
|
+
*/
|
|
43
|
+
interface IERC734 {
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @dev Adds a _key to the identity. MUST only be done by keys of purpose MANAGEMENT,
|
|
47
|
+
* or the identity itself.
|
|
48
|
+
*/
|
|
49
|
+
function addKey(bytes32 _key, uint256 _purpose, uint256 _keyType) external returns (bool success);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @dev Removes _purpose for _key from the identity. MUST only be done by keys of purpose
|
|
53
|
+
* MANAGEMENT, or the identity itself.
|
|
54
|
+
*/
|
|
55
|
+
function removeKey(bytes32 _key, uint256 _purpose) external returns (bool success);
|
|
56
|
+
|
|
57
|
+
/// @dev Returns the full key data, if present.
|
|
58
|
+
function getKey(bytes32 _key) external view returns (uint256[] memory purposes, uint256 keyType, bytes32 key);
|
|
59
|
+
|
|
60
|
+
/// @dev Returns the purposes for a key.
|
|
61
|
+
function getKeyPurposes(bytes32 _key) external view returns (uint256[] memory _purposes);
|
|
62
|
+
|
|
63
|
+
/// @dev Returns the key hashes registered with a given purpose.
|
|
64
|
+
function getKeysByPurpose(uint256 _purpose) external view returns (bytes32[] memory keys);
|
|
65
|
+
|
|
66
|
+
/// @dev Returns TRUE if a key has the given purpose, or MANAGEMENT (universal).
|
|
67
|
+
function keyHasPurpose(bytes32 _key, uint256 _purpose) external view returns (bool exists);
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
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.27;
|
|
24
|
+
|
|
25
|
+
import { Structs } from "../storage/Structs.sol";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @dev interface of the ERC735 (Claim Holder) standard as defined in the EIP.
|
|
29
|
+
*
|
|
30
|
+
* Note on ABI: this interface follows the EIP-735 shape, with two OnchainID-specific
|
|
31
|
+
* adjustments. The claim's signed payload (`data`) is structured as `Structs.ClaimData`
|
|
32
|
+
* (`issuedAt`, `validUntil`, `payload`) instead of raw bytes, which makes typed-data
|
|
33
|
+
* signing legible to wallets and lets claims carry time bounds without convention. And
|
|
34
|
+
* the events carry the subject identity as their first indexed field: the claim registry
|
|
35
|
+
* is served by a module singleton shared across identities, so neither the emitter
|
|
36
|
+
* address nor `claimId` (derived from `(issuer, topic)` alone) can attribute a log to an
|
|
37
|
+
* identity. `claimId` is unindexed to make room — it stays filterable through the
|
|
38
|
+
* indexed `topic` and `issuer` it is derived from.
|
|
39
|
+
*/
|
|
40
|
+
interface IERC735 {
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @dev Emitted when a claim was added.
|
|
44
|
+
*
|
|
45
|
+
* Specification: MUST be triggered when a claim was successfully added.
|
|
46
|
+
*/
|
|
47
|
+
event ClaimAdded(
|
|
48
|
+
address indexed identity,
|
|
49
|
+
bytes32 claimId,
|
|
50
|
+
uint256 indexed topic,
|
|
51
|
+
uint256 scheme,
|
|
52
|
+
address indexed issuer,
|
|
53
|
+
bytes signature,
|
|
54
|
+
Structs.ClaimData data,
|
|
55
|
+
string uri
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @dev Emitted when a claim was removed.
|
|
60
|
+
*
|
|
61
|
+
* Specification: MUST be triggered when removeClaim was successfully called.
|
|
62
|
+
*/
|
|
63
|
+
event ClaimRemoved(
|
|
64
|
+
address indexed identity,
|
|
65
|
+
bytes32 claimId,
|
|
66
|
+
uint256 indexed topic,
|
|
67
|
+
uint256 scheme,
|
|
68
|
+
address indexed issuer,
|
|
69
|
+
bytes signature,
|
|
70
|
+
Structs.ClaimData data,
|
|
71
|
+
string uri
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @dev Emitted when a claim was changed.
|
|
76
|
+
*
|
|
77
|
+
* Specification: MUST be triggered when addClaim was successfully called on an existing claimId.
|
|
78
|
+
*/
|
|
79
|
+
event ClaimChanged(
|
|
80
|
+
address indexed identity,
|
|
81
|
+
bytes32 claimId,
|
|
82
|
+
uint256 indexed topic,
|
|
83
|
+
uint256 scheme,
|
|
84
|
+
address indexed issuer,
|
|
85
|
+
bytes signature,
|
|
86
|
+
Structs.ClaimData data,
|
|
87
|
+
string uri
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @dev Add or update a claim.
|
|
92
|
+
*
|
|
93
|
+
* Triggers Event: `ClaimAdded`, `ClaimChanged`
|
|
94
|
+
*
|
|
95
|
+
* Specification: Add or update a claim from an issuer.
|
|
96
|
+
*
|
|
97
|
+
* _signature is over an EIP-712 typed data hash computed by the issuer contract's `getClaimHash()`.
|
|
98
|
+
* The EIP-712 type is:
|
|
99
|
+
* `Claim(uint256 topic,address subject,ClaimData data)`
|
|
100
|
+
* `ClaimData(uint256 issuedAt,uint256 validUntil,Metadata metadata,bytes payload)`
|
|
101
|
+
* `Metadata(uint256 scheme,string uri)`
|
|
102
|
+
* `_data.metadataHash` must equal the EIP-712 hash of `Metadata(_scheme, _uri)`, which binds
|
|
103
|
+
* both fields to the signature; a mismatch reverts. Signers see the actual scheme and uri
|
|
104
|
+
* in their wallet, while on-chain only the struct hash is stored.
|
|
105
|
+
* Claim IDs are generated using `keccak256(abi.encode(address issuer_address, uint256 topic))`.
|
|
106
|
+
*/
|
|
107
|
+
function addClaim(
|
|
108
|
+
uint256 _topic,
|
|
109
|
+
uint256 _scheme,
|
|
110
|
+
address issuer,
|
|
111
|
+
bytes calldata _signature,
|
|
112
|
+
Structs.ClaimData calldata _data,
|
|
113
|
+
string calldata _uri
|
|
114
|
+
) external returns (bytes32 claimRequestId);
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @dev Removes a claim.
|
|
118
|
+
*
|
|
119
|
+
* Triggers Event: `ClaimRemoved`
|
|
120
|
+
*
|
|
121
|
+
* Claim IDs are generated using `keccak256(abi.encode(address issuer_address, uint256 topic))`.
|
|
122
|
+
* The removed claim's EIP-712 digest is marked spent, so the exact same `(issuer, topic, data)`
|
|
123
|
+
* cannot be re-added.
|
|
124
|
+
*/
|
|
125
|
+
function removeClaim(bytes32 _claimId) external returns (bool success);
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @dev Get a claim by its ID.
|
|
129
|
+
*
|
|
130
|
+
* Claim IDs are generated using `keccak256(abi.encode(address issuer_address, uint256 topic))`.
|
|
131
|
+
*/
|
|
132
|
+
function getClaim(bytes32 _claimId)
|
|
133
|
+
external
|
|
134
|
+
view
|
|
135
|
+
returns (
|
|
136
|
+
uint256 topic,
|
|
137
|
+
uint256 scheme,
|
|
138
|
+
address issuer,
|
|
139
|
+
bytes memory signature,
|
|
140
|
+
Structs.ClaimData memory data,
|
|
141
|
+
string memory uri
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @dev Returns an array of claim IDs by topic.
|
|
146
|
+
*/
|
|
147
|
+
function getClaimIdsByTopic(uint256 _topic) external view returns (bytes32[] memory claimIds);
|
|
148
|
+
|
|
149
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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.27;
|
|
24
|
+
|
|
25
|
+
import { Structs } from "../storage/Structs.sol";
|
|
26
|
+
import { IERC734 } from "./IERC734.sol";
|
|
27
|
+
import { IERC735 } from "./IERC735.sol";
|
|
28
|
+
|
|
29
|
+
// solhint-disable-next-line no-empty-blocks
|
|
30
|
+
interface IIdentity is IERC734, IERC735 {
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @dev Checks if a claim is valid.
|
|
34
|
+
* @param _identity the identity contract related to the claim
|
|
35
|
+
* @param claimTopic the claim topic of the claim
|
|
36
|
+
* @param sig the signature of the claim
|
|
37
|
+
* @param data the structured claim data
|
|
38
|
+
* @return claimValid true if the claim is valid, false otherwise
|
|
39
|
+
*/
|
|
40
|
+
function isClaimValid(IIdentity _identity, uint256 claimTopic, bytes calldata sig, Structs.ClaimData calldata data)
|
|
41
|
+
external
|
|
42
|
+
view
|
|
43
|
+
returns (bool);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @dev Computes the EIP-712 claim digest for off-chain signing.
|
|
47
|
+
* @param _identity The identity address the claim is for
|
|
48
|
+
* @param _topic The claim topic
|
|
49
|
+
* @param _data The structured claim data
|
|
50
|
+
* @return The EIP-712 typed data hash
|
|
51
|
+
*/
|
|
52
|
+
function getClaimHash(address _identity, uint256 _topic, Structs.ClaimData memory _data)
|
|
53
|
+
external
|
|
54
|
+
view
|
|
55
|
+
returns (bytes32);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @dev Returns the identity type set at initialization.
|
|
59
|
+
* @return The identity type (see IdentityTypes library)
|
|
60
|
+
*/
|
|
61
|
+
function getIdentityType() external view returns (uint256);
|
|
62
|
+
|
|
63
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
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.27;
|
|
24
|
+
|
|
25
|
+
import { Structs } from "../storage/Structs.sol";
|
|
26
|
+
|
|
27
|
+
/// @title IIdentityUtilities
|
|
28
|
+
/// @notice Interface for a schema registry that maps topic IDs to structured metadata schemas
|
|
29
|
+
/// @dev Each topic is uniquely identified and contains ABI-encoded arrays of field names and types
|
|
30
|
+
interface IIdentityUtilities {
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @notice Struct that defines a registered topic schema
|
|
34
|
+
* @param name Human-readable name of the topic
|
|
35
|
+
* @param encodedFieldNames ABI-encoded string array representing field names
|
|
36
|
+
* @param encodedFieldTypes ABI-encoded string array representing field types (e.g. "uint256", "string[]")
|
|
37
|
+
*/
|
|
38
|
+
struct TopicInfo {
|
|
39
|
+
string name;
|
|
40
|
+
bytes encodedFieldNames;
|
|
41
|
+
bytes encodedFieldTypes;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
struct ClaimInfo {
|
|
45
|
+
TopicInfo topic;
|
|
46
|
+
bool isValid;
|
|
47
|
+
bytes32 claimId;
|
|
48
|
+
uint256 scheme;
|
|
49
|
+
address issuer;
|
|
50
|
+
bytes signature;
|
|
51
|
+
Structs.ClaimData data;
|
|
52
|
+
string uri;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @notice Emitted when a new topic is added to the registry
|
|
56
|
+
* @param topicId The unique identifier for the topic
|
|
57
|
+
* @param name Human-readable name of the topic
|
|
58
|
+
* @param encodedFieldNames ABI-encoded string[] representing the names of the fields
|
|
59
|
+
* @param encodedFieldTypes ABI-encoded string[] representing the types of the fields
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
event TopicAdded(uint256 indexed topicId, string name, bytes encodedFieldNames, bytes encodedFieldTypes);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @notice Emitted when an existing topic is updated
|
|
66
|
+
* @param topicId The ID of the topic that was updated
|
|
67
|
+
* @param name New human-readable name of the topic
|
|
68
|
+
* @param encodedFieldNames Updated ABI-encoded string[] of field names
|
|
69
|
+
* @param encodedFieldTypes Updated ABI-encoded string[] of field types
|
|
70
|
+
*/
|
|
71
|
+
event TopicUpdated(uint256 indexed topicId, string name, bytes encodedFieldNames, bytes encodedFieldTypes);
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @notice Emitted when a topic is removed from the registry
|
|
75
|
+
* @param topicId The ID of the removed topic
|
|
76
|
+
*/
|
|
77
|
+
event TopicRemoved(uint256 indexed topicId);
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @notice Registers a new topic with its name and schema definition
|
|
81
|
+
* @param topicId The unique identifier of the topic to add
|
|
82
|
+
* @param name Human-readable name of the topic
|
|
83
|
+
* @param encodedFieldNames ABI-encoded string[] of field names
|
|
84
|
+
* @param encodedFieldTypes ABI-encoded string[] of field types
|
|
85
|
+
*/
|
|
86
|
+
function addTopic(
|
|
87
|
+
uint256 topicId,
|
|
88
|
+
string calldata name,
|
|
89
|
+
bytes calldata encodedFieldNames,
|
|
90
|
+
bytes calldata encodedFieldTypes
|
|
91
|
+
) external;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @notice Updates an existing topic's name and schema
|
|
95
|
+
* @param topicId The ID of the topic to update
|
|
96
|
+
* @param name New name of the topic
|
|
97
|
+
* @param encodedFieldNames New ABI-encoded string[] of field names
|
|
98
|
+
* @param encodedFieldTypes New ABI-encoded string[] of field types
|
|
99
|
+
*/
|
|
100
|
+
function updateTopic(
|
|
101
|
+
uint256 topicId,
|
|
102
|
+
string calldata name,
|
|
103
|
+
bytes calldata encodedFieldNames,
|
|
104
|
+
bytes calldata encodedFieldTypes
|
|
105
|
+
) external;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @notice Removes a topic from the registry
|
|
109
|
+
* @param topicId The ID of the topic to remove
|
|
110
|
+
*/
|
|
111
|
+
function removeTopic(uint256 topicId) external;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @notice Retrieves the raw TopicInfo struct associated with a given topic ID
|
|
115
|
+
* @param topicId The ID of the topic to retrieve
|
|
116
|
+
* @return topic The full TopicInfo struct containing the name, encoded field names, and types
|
|
117
|
+
*/
|
|
118
|
+
function getTopic(uint256 topicId) external view returns (TopicInfo memory topic);
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @notice Returns the decoded schema of a topic
|
|
122
|
+
* @param topicId The ID of the topic
|
|
123
|
+
* @return fieldNames Decoded string array of field names
|
|
124
|
+
* @return fieldTypes Decoded string array of field types
|
|
125
|
+
*/
|
|
126
|
+
function getSchema(uint256 topicId) external view returns (string[] memory fieldNames, string[] memory fieldTypes);
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @notice Returns an array of TopicInfo structs for the given topic IDs
|
|
130
|
+
* @param topicIds Array of topic IDs to get TopicInfo structs for
|
|
131
|
+
* @return TopicInfo[] Array of TopicInfo structs corresponding to the input topic IDs
|
|
132
|
+
*/
|
|
133
|
+
function getTopicInfos(uint256[] calldata topicIds) external view returns (TopicInfo[] memory);
|
|
134
|
+
|
|
135
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
/**
|
|
26
|
+
* @title IKeyExecutor
|
|
27
|
+
* @notice Externalized execution surface for ERC-734 identities, served by the
|
|
28
|
+
* {KeyApprovalModule} via the identity's ERC-7579 fallback handler.
|
|
29
|
+
*
|
|
30
|
+
* @dev Exposes the legacy `execute` / `approve` ABI as a separate Solidity type so that
|
|
31
|
+
* callers can `IKeyExecutor(address(identity)).execute(...)` without forcing the
|
|
32
|
+
* account contract itself to declare these as concrete methods. At the wire level
|
|
33
|
+
* these selectors are identical to the original ERC-734 selectors, so on-chain
|
|
34
|
+
* consumers keep calling them as ERC-734 calls.
|
|
35
|
+
*
|
|
36
|
+
* The lifecycle events below are NOT the canonical ERC-734 ones: the queue module is a
|
|
37
|
+
* singleton emitting on its own address for every identity that installs it, so each
|
|
38
|
+
* event carries `address indexed account` (the identity) as its first field. Indexers
|
|
39
|
+
* must filter on that field, not on the emitter.
|
|
40
|
+
*
|
|
41
|
+
* See {KeyApprovalModule} for the implementation and the auto-approval rule table.
|
|
42
|
+
*/
|
|
43
|
+
interface IKeyExecutor {
|
|
44
|
+
|
|
45
|
+
/// @dev Emitted when an identity queues an execution via {execute}.
|
|
46
|
+
event ExecutionRequested(
|
|
47
|
+
address indexed account,
|
|
48
|
+
uint256 indexed executionId,
|
|
49
|
+
address indexed to,
|
|
50
|
+
uint256 value,
|
|
51
|
+
bytes data,
|
|
52
|
+
address proposer
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
/// @dev Emitted when an execution is approved (or rejected) via {approve}.
|
|
56
|
+
event Approved(address indexed account, uint256 indexed executionId, bool approved);
|
|
57
|
+
|
|
58
|
+
/// @dev Emitted when an uninstall voids every request queued below `firstValidId`.
|
|
59
|
+
event QueueInvalidated(address indexed account, uint256 firstValidId);
|
|
60
|
+
|
|
61
|
+
/// @dev Emitted when an approved execution successfully dispatches through the account.
|
|
62
|
+
event Executed(address indexed account, uint256 indexed executionId, address indexed to, uint256 value, bytes data);
|
|
63
|
+
|
|
64
|
+
/// @dev Emitted when an approved execution reverts inside the account.
|
|
65
|
+
event ExecutionFailed(
|
|
66
|
+
address indexed account, uint256 indexed executionId, address indexed to, uint256 value, bytes data
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @notice Queue (and possibly auto-execute) a call from the identity.
|
|
71
|
+
* @return executionId opaque id used with {approve} if the call was queued, not auto-approved.
|
|
72
|
+
*/
|
|
73
|
+
function execute(address _to, uint256 _value, bytes calldata _data) external payable returns (uint256 executionId);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @notice Approve (or reject) a previously queued execution. Caller's keyHash is recovered
|
|
77
|
+
* from the ERC-2771 trailing-bytes convention.
|
|
78
|
+
*/
|
|
79
|
+
function approve(uint256 _id, bool _shouldApprove) external returns (bool success);
|
|
80
|
+
|
|
81
|
+
/// @notice Current execution nonce for the calling identity.
|
|
82
|
+
function getCurrentNonce() external view returns (uint256);
|
|
83
|
+
|
|
84
|
+
}
|