@coti-io/coti-contracts 1.0.0 → 1.0.3
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/.github/workflows/npm-publish.yml +2 -1
- package/CONTRIBUTING.md +2 -2
- package/LICENSE +1 -1
- package/README.md +18 -35
- package/contracts/access/DataPrivacyFramework/extensions/DataPrivacyFrameworkMpc.sol +112 -0
- package/contracts/mocks/utils/mpc/ArithmeticTestsContract.sol +152 -0
- package/contracts/mocks/utils/mpc/BitwiseTestsContract.sol +11 -1
- package/contracts/mocks/utils/mpc/Comparison2TestsContract.sol +8 -0
- package/contracts/mocks/utils/mpc/Miscellaneous1TestsContract.sol +33 -4
- package/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract.sol +35 -10
- package/contracts/mocks/utils/mpc/ShiftTestsContract.sol +126 -0
- package/contracts/mocks/utils/mpc/TransferTestsContract.sol +3 -0
- package/contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract.sol +222 -0
- package/contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract.sol +222 -0
- package/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol +223 -0
- package/contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract.sol +222 -0
- package/contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract.sol +265 -0
- package/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol +281 -0
- package/contracts/token/PrivateERC20/PrivateERC20.sol +1 -1
- package/contracts/token/PrivateERC721/IERC721Errors.sol +57 -0
- package/contracts/token/PrivateERC721/PrivateERC721.sol +1 -1
- package/contracts/utils/mpc/MpcCore.sol +40 -0
- package/contracts/utils/mpc/MpcInterface.sol +2 -0
- package/hardhat.config.ts +9 -1
- package/package.json +20 -4
- package/test/onboard/AccountOnboard.test.ts +2 -2
- package/test/token/PrivateERC20/PrivateERC20.test.ts +2 -2
- package/test/utils/accounts.ts +2 -2
- package/test/utils/mpc/Precompile.test.ts +24 -2
- package/typechain-types/@openzeppelin/contracts/interfaces/index.ts +0 -2
- package/typechain-types/contracts/GasTest.ts +91 -0
- package/typechain-types/contracts/mocks/utils/mpc/ArithmeticTestsContract.ts +66 -0
- package/typechain-types/contracts/mocks/utils/mpc/BitwiseTestsContract.ts +6 -0
- package/typechain-types/contracts/mocks/utils/mpc/Comparison2TestsContract.ts +6 -0
- package/typechain-types/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract.ts +36 -6
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/TransferWithAllowance64TestsContract.ts +251 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/TransferWithAllowanceTestsContract.ts +250 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/index.ts +5 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.ts +389 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract.ts +391 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract.ts +391 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/TransferWithAllowance64_64TestsContract.ts +391 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/TransferWithAllowance64_8TestsContract.ts +391 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/index.ts +5 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.ts +391 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract.ts +391 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract.ts +306 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/TransferTestsContract.ts +125 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/TransferWithAllowanceTestsContract.ts +125 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/index.ts +5 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.ts +296 -0
- package/typechain-types/contracts/mocks/utils/mpc/index.ts +7 -0
- package/typechain-types/contracts/token/PrivateERC721/IERC721Errors.ts +69 -0
- package/typechain-types/contracts/token/PrivateERC721/index.ts +1 -0
- package/typechain-types/contracts/utils/mpc/MpcInterface.sol/ExtendedOperations.ts +38 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/index.ts +0 -1
- package/typechain-types/factories/contracts/GasTest__factory.ts +75 -0
- package/typechain-types/factories/contracts/mocks/access/DataPrivacyFramework/DataPrivacyFrameworkMock__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20Mock__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/token/PrivateERC721/PrivateERC721URIStorageMock__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/ArithmeticTestsContract__factory.ts +73 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/BitwiseTestsContract__factory.ts +11 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison1TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison2TestsContract__factory.ts +11 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/MinMaxTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Miscellaneous1TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/MiscellaneousTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract__factory.ts +26 -30
- package/typechain-types/factories/contracts/mocks/utils/mpc/ShiftTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/StringTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferScalarTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/TransferWithAllowance64TestsContract__factory.ts +294 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/TransferWithAllowanceTestsContract__factory.ts +292 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/index.ts +5 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract__factory.ts +720 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract__factory.ts +724 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract__factory.ts +724 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/TransferWithAllowance64_64TestsContract__factory.ts +724 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/TransferWithAllowance64_8TestsContract__factory.ts +724 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/index.ts +5 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract__factory.ts +724 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract__factory.ts +724 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract__factory.ts +507 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/TransferTestsContract__factory.ts +150 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/TransferWithAllowanceTestsContract__factory.ts +150 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/index.ts +5 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract__factory.ts +434 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/index.ts +7 -0
- package/typechain-types/factories/contracts/mocks/wallet/PrivateERC20Wallet/PrivateERC20WalletMock__factory.ts +1 -1
- package/typechain-types/factories/contracts/onboard/AccountOnboard__factory.ts +1 -1
- package/typechain-types/factories/contracts/token/PrivateERC721/IERC721Errors__factory.ts +128 -0
- package/typechain-types/factories/contracts/token/PrivateERC721/index.ts +1 -0
- package/typechain-types/factories/contracts/utils/mpc/MpcCore__factory.ts +1 -1
- package/typechain-types/factories/contracts/utils/mpc/MpcInterface.sol/ExtendedOperations__factory.ts +58 -0
- package/typechain-types/hardhat.d.ts +144 -54
- package/typechain-types/index.ts +16 -6
- package/contracts/access/DataPrivacyFramework/README.md +0 -68
- package/contracts/onboard/README.md +0 -65
- package/contracts/token/PrivateERC20/README.md +0 -104
- package/contracts/token/PrivateERC721/README.md +0 -282
- package/contracts/utils/mpc/README.md +0 -82
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import { Contract, Interface, type ContractRunner } from "ethers";
|
|
6
|
+
import type {
|
|
7
|
+
IERC721Errors,
|
|
8
|
+
IERC721ErrorsInterface,
|
|
9
|
+
} from "../../../../contracts/token/PrivateERC721/IERC721Errors";
|
|
10
|
+
|
|
11
|
+
const _abi = [
|
|
12
|
+
{
|
|
13
|
+
inputs: [
|
|
14
|
+
{
|
|
15
|
+
internalType: "address",
|
|
16
|
+
name: "sender",
|
|
17
|
+
type: "address",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
internalType: "uint256",
|
|
21
|
+
name: "tokenId",
|
|
22
|
+
type: "uint256",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
internalType: "address",
|
|
26
|
+
name: "owner",
|
|
27
|
+
type: "address",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
name: "ERC721IncorrectOwner",
|
|
31
|
+
type: "error",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
inputs: [
|
|
35
|
+
{
|
|
36
|
+
internalType: "address",
|
|
37
|
+
name: "operator",
|
|
38
|
+
type: "address",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
internalType: "uint256",
|
|
42
|
+
name: "tokenId",
|
|
43
|
+
type: "uint256",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
name: "ERC721InsufficientApproval",
|
|
47
|
+
type: "error",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
inputs: [
|
|
51
|
+
{
|
|
52
|
+
internalType: "address",
|
|
53
|
+
name: "approver",
|
|
54
|
+
type: "address",
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
name: "ERC721InvalidApprover",
|
|
58
|
+
type: "error",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
inputs: [
|
|
62
|
+
{
|
|
63
|
+
internalType: "address",
|
|
64
|
+
name: "operator",
|
|
65
|
+
type: "address",
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
name: "ERC721InvalidOperator",
|
|
69
|
+
type: "error",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
inputs: [
|
|
73
|
+
{
|
|
74
|
+
internalType: "address",
|
|
75
|
+
name: "owner",
|
|
76
|
+
type: "address",
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
name: "ERC721InvalidOwner",
|
|
80
|
+
type: "error",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
inputs: [
|
|
84
|
+
{
|
|
85
|
+
internalType: "address",
|
|
86
|
+
name: "receiver",
|
|
87
|
+
type: "address",
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
name: "ERC721InvalidReceiver",
|
|
91
|
+
type: "error",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
inputs: [
|
|
95
|
+
{
|
|
96
|
+
internalType: "address",
|
|
97
|
+
name: "sender",
|
|
98
|
+
type: "address",
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
name: "ERC721InvalidSender",
|
|
102
|
+
type: "error",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
inputs: [
|
|
106
|
+
{
|
|
107
|
+
internalType: "uint256",
|
|
108
|
+
name: "tokenId",
|
|
109
|
+
type: "uint256",
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
name: "ERC721NonexistentToken",
|
|
113
|
+
type: "error",
|
|
114
|
+
},
|
|
115
|
+
] as const;
|
|
116
|
+
|
|
117
|
+
export class IERC721Errors__factory {
|
|
118
|
+
static readonly abi = _abi;
|
|
119
|
+
static createInterface(): IERC721ErrorsInterface {
|
|
120
|
+
return new Interface(_abi) as IERC721ErrorsInterface;
|
|
121
|
+
}
|
|
122
|
+
static connect(
|
|
123
|
+
address: string,
|
|
124
|
+
runner?: ContractRunner | null
|
|
125
|
+
): IERC721Errors {
|
|
126
|
+
return new Contract(address, _abi, runner) as unknown as IERC721Errors;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -31,7 +31,7 @@ const _abi = [
|
|
|
31
31
|
] as const;
|
|
32
32
|
|
|
33
33
|
const _bytecode =
|
|
34
|
-
"
|
|
34
|
+
"0x6088610038600b82828239805160001a607314602b57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361060335760003560e01c806331b943d5146038575b600080fd5b604061010081565b60405190815260200160405180910390f3fea264697066735822122040c65ea5afa96eff66cf350fb22ea880d56d7562c3beff5ff995e04971be8f4664736f6c63430008130033";
|
|
35
35
|
|
|
36
36
|
type MpcCoreConstructorParams =
|
|
37
37
|
| [signer?: Signer]
|
|
@@ -781,6 +781,64 @@ const _abi = [
|
|
|
781
781
|
stateMutability: "nonpayable",
|
|
782
782
|
type: "function",
|
|
783
783
|
},
|
|
784
|
+
{
|
|
785
|
+
inputs: [
|
|
786
|
+
{
|
|
787
|
+
internalType: "bytes3",
|
|
788
|
+
name: "metaData",
|
|
789
|
+
type: "bytes3",
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
internalType: "uint256",
|
|
793
|
+
name: "lhs",
|
|
794
|
+
type: "uint256",
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
internalType: "uint256",
|
|
798
|
+
name: "rhs",
|
|
799
|
+
type: "uint256",
|
|
800
|
+
},
|
|
801
|
+
],
|
|
802
|
+
name: "Shl",
|
|
803
|
+
outputs: [
|
|
804
|
+
{
|
|
805
|
+
internalType: "uint256",
|
|
806
|
+
name: "result",
|
|
807
|
+
type: "uint256",
|
|
808
|
+
},
|
|
809
|
+
],
|
|
810
|
+
stateMutability: "nonpayable",
|
|
811
|
+
type: "function",
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
inputs: [
|
|
815
|
+
{
|
|
816
|
+
internalType: "bytes3",
|
|
817
|
+
name: "metaData",
|
|
818
|
+
type: "bytes3",
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
internalType: "uint256",
|
|
822
|
+
name: "lhs",
|
|
823
|
+
type: "uint256",
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
internalType: "uint256",
|
|
827
|
+
name: "rhs",
|
|
828
|
+
type: "uint256",
|
|
829
|
+
},
|
|
830
|
+
],
|
|
831
|
+
name: "Shr",
|
|
832
|
+
outputs: [
|
|
833
|
+
{
|
|
834
|
+
internalType: "uint256",
|
|
835
|
+
name: "result",
|
|
836
|
+
type: "uint256",
|
|
837
|
+
},
|
|
838
|
+
],
|
|
839
|
+
stateMutability: "nonpayable",
|
|
840
|
+
type: "function",
|
|
841
|
+
},
|
|
784
842
|
{
|
|
785
843
|
inputs: [
|
|
786
844
|
{
|
|
@@ -13,18 +13,6 @@ import * as Contracts from ".";
|
|
|
13
13
|
|
|
14
14
|
declare module "hardhat/types/runtime" {
|
|
15
15
|
interface HardhatEthersHelpers extends HardhatEthersHelpersBase {
|
|
16
|
-
getContractFactory(
|
|
17
|
-
name: "IERC1155Errors",
|
|
18
|
-
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
19
|
-
): Promise<Contracts.IERC1155Errors__factory>;
|
|
20
|
-
getContractFactory(
|
|
21
|
-
name: "IERC20Errors",
|
|
22
|
-
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
23
|
-
): Promise<Contracts.IERC20Errors__factory>;
|
|
24
|
-
getContractFactory(
|
|
25
|
-
name: "IERC721Errors",
|
|
26
|
-
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
27
|
-
): Promise<Contracts.IERC721Errors__factory>;
|
|
28
16
|
getContractFactory(
|
|
29
17
|
name: "IERC4906",
|
|
30
18
|
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
@@ -97,6 +85,10 @@ declare module "hardhat/types/runtime" {
|
|
|
97
85
|
name: "OffboardToUserKeyTestContract",
|
|
98
86
|
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
99
87
|
): Promise<Contracts.OffboardToUserKeyTestContract__factory>;
|
|
88
|
+
getContractFactory(
|
|
89
|
+
name: "ShiftTestsContract",
|
|
90
|
+
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
91
|
+
): Promise<Contracts.ShiftTestsContract__factory>;
|
|
100
92
|
getContractFactory(
|
|
101
93
|
name: "StringTestsContract",
|
|
102
94
|
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
@@ -109,6 +101,30 @@ declare module "hardhat/types/runtime" {
|
|
|
109
101
|
name: "TransferTestsContract",
|
|
110
102
|
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
111
103
|
): Promise<Contracts.TransferTestsContract__factory>;
|
|
104
|
+
getContractFactory(
|
|
105
|
+
name: "TransferWithAllowance64_16TestsContract",
|
|
106
|
+
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
107
|
+
): Promise<Contracts.TransferWithAllowance64_16TestsContract__factory>;
|
|
108
|
+
getContractFactory(
|
|
109
|
+
name: "TransferWithAllowance64_32TestsContract",
|
|
110
|
+
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
111
|
+
): Promise<Contracts.TransferWithAllowance64_32TestsContract__factory>;
|
|
112
|
+
getContractFactory(
|
|
113
|
+
name: "TransferWithAllowance64_64TestsContract",
|
|
114
|
+
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
115
|
+
): Promise<Contracts.TransferWithAllowance64_64TestsContract__factory>;
|
|
116
|
+
getContractFactory(
|
|
117
|
+
name: "TransferWithAllowance64_8TestsContract",
|
|
118
|
+
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
119
|
+
): Promise<Contracts.TransferWithAllowance64_8TestsContract__factory>;
|
|
120
|
+
getContractFactory(
|
|
121
|
+
name: "TransferWithAllowanceScalarTestsContract",
|
|
122
|
+
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
123
|
+
): Promise<Contracts.TransferWithAllowanceScalarTestsContract__factory>;
|
|
124
|
+
getContractFactory(
|
|
125
|
+
name: "TransferWithAllowanceTestsContract",
|
|
126
|
+
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
127
|
+
): Promise<Contracts.TransferWithAllowanceTestsContract__factory>;
|
|
112
128
|
getContractFactory(
|
|
113
129
|
name: "PrivateERC20WalletMock",
|
|
114
130
|
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
@@ -129,6 +145,10 @@ declare module "hardhat/types/runtime" {
|
|
|
129
145
|
name: "PrivateERC721URIStorage",
|
|
130
146
|
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
131
147
|
): Promise<Contracts.PrivateERC721URIStorage__factory>;
|
|
148
|
+
getContractFactory(
|
|
149
|
+
name: "IERC721Errors",
|
|
150
|
+
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
151
|
+
): Promise<Contracts.IERC721Errors__factory>;
|
|
132
152
|
getContractFactory(
|
|
133
153
|
name: "PrivateERC721",
|
|
134
154
|
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
@@ -142,21 +162,6 @@ declare module "hardhat/types/runtime" {
|
|
|
142
162
|
signerOrOptions?: ethers.Signer | FactoryOptions
|
|
143
163
|
): Promise<Contracts.ExtendedOperations__factory>;
|
|
144
164
|
|
|
145
|
-
getContractAt(
|
|
146
|
-
name: "IERC1155Errors",
|
|
147
|
-
address: string | ethers.Addressable,
|
|
148
|
-
signer?: ethers.Signer
|
|
149
|
-
): Promise<Contracts.IERC1155Errors>;
|
|
150
|
-
getContractAt(
|
|
151
|
-
name: "IERC20Errors",
|
|
152
|
-
address: string | ethers.Addressable,
|
|
153
|
-
signer?: ethers.Signer
|
|
154
|
-
): Promise<Contracts.IERC20Errors>;
|
|
155
|
-
getContractAt(
|
|
156
|
-
name: "IERC721Errors",
|
|
157
|
-
address: string | ethers.Addressable,
|
|
158
|
-
signer?: ethers.Signer
|
|
159
|
-
): Promise<Contracts.IERC721Errors>;
|
|
160
165
|
getContractAt(
|
|
161
166
|
name: "IERC4906",
|
|
162
167
|
address: string | ethers.Addressable,
|
|
@@ -247,6 +252,11 @@ declare module "hardhat/types/runtime" {
|
|
|
247
252
|
address: string | ethers.Addressable,
|
|
248
253
|
signer?: ethers.Signer
|
|
249
254
|
): Promise<Contracts.OffboardToUserKeyTestContract>;
|
|
255
|
+
getContractAt(
|
|
256
|
+
name: "ShiftTestsContract",
|
|
257
|
+
address: string | ethers.Addressable,
|
|
258
|
+
signer?: ethers.Signer
|
|
259
|
+
): Promise<Contracts.ShiftTestsContract>;
|
|
250
260
|
getContractAt(
|
|
251
261
|
name: "StringTestsContract",
|
|
252
262
|
address: string | ethers.Addressable,
|
|
@@ -262,6 +272,36 @@ declare module "hardhat/types/runtime" {
|
|
|
262
272
|
address: string | ethers.Addressable,
|
|
263
273
|
signer?: ethers.Signer
|
|
264
274
|
): Promise<Contracts.TransferTestsContract>;
|
|
275
|
+
getContractAt(
|
|
276
|
+
name: "TransferWithAllowance64_16TestsContract",
|
|
277
|
+
address: string | ethers.Addressable,
|
|
278
|
+
signer?: ethers.Signer
|
|
279
|
+
): Promise<Contracts.TransferWithAllowance64_16TestsContract>;
|
|
280
|
+
getContractAt(
|
|
281
|
+
name: "TransferWithAllowance64_32TestsContract",
|
|
282
|
+
address: string | ethers.Addressable,
|
|
283
|
+
signer?: ethers.Signer
|
|
284
|
+
): Promise<Contracts.TransferWithAllowance64_32TestsContract>;
|
|
285
|
+
getContractAt(
|
|
286
|
+
name: "TransferWithAllowance64_64TestsContract",
|
|
287
|
+
address: string | ethers.Addressable,
|
|
288
|
+
signer?: ethers.Signer
|
|
289
|
+
): Promise<Contracts.TransferWithAllowance64_64TestsContract>;
|
|
290
|
+
getContractAt(
|
|
291
|
+
name: "TransferWithAllowance64_8TestsContract",
|
|
292
|
+
address: string | ethers.Addressable,
|
|
293
|
+
signer?: ethers.Signer
|
|
294
|
+
): Promise<Contracts.TransferWithAllowance64_8TestsContract>;
|
|
295
|
+
getContractAt(
|
|
296
|
+
name: "TransferWithAllowanceScalarTestsContract",
|
|
297
|
+
address: string | ethers.Addressable,
|
|
298
|
+
signer?: ethers.Signer
|
|
299
|
+
): Promise<Contracts.TransferWithAllowanceScalarTestsContract>;
|
|
300
|
+
getContractAt(
|
|
301
|
+
name: "TransferWithAllowanceTestsContract",
|
|
302
|
+
address: string | ethers.Addressable,
|
|
303
|
+
signer?: ethers.Signer
|
|
304
|
+
): Promise<Contracts.TransferWithAllowanceTestsContract>;
|
|
265
305
|
getContractAt(
|
|
266
306
|
name: "PrivateERC20WalletMock",
|
|
267
307
|
address: string | ethers.Addressable,
|
|
@@ -287,6 +327,11 @@ declare module "hardhat/types/runtime" {
|
|
|
287
327
|
address: string | ethers.Addressable,
|
|
288
328
|
signer?: ethers.Signer
|
|
289
329
|
): Promise<Contracts.PrivateERC721URIStorage>;
|
|
330
|
+
getContractAt(
|
|
331
|
+
name: "IERC721Errors",
|
|
332
|
+
address: string | ethers.Addressable,
|
|
333
|
+
signer?: ethers.Signer
|
|
334
|
+
): Promise<Contracts.IERC721Errors>;
|
|
290
335
|
getContractAt(
|
|
291
336
|
name: "PrivateERC721",
|
|
292
337
|
address: string | ethers.Addressable,
|
|
@@ -303,18 +348,6 @@ declare module "hardhat/types/runtime" {
|
|
|
303
348
|
signer?: ethers.Signer
|
|
304
349
|
): Promise<Contracts.ExtendedOperations>;
|
|
305
350
|
|
|
306
|
-
deployContract(
|
|
307
|
-
name: "IERC1155Errors",
|
|
308
|
-
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
309
|
-
): Promise<Contracts.IERC1155Errors>;
|
|
310
|
-
deployContract(
|
|
311
|
-
name: "IERC20Errors",
|
|
312
|
-
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
313
|
-
): Promise<Contracts.IERC20Errors>;
|
|
314
|
-
deployContract(
|
|
315
|
-
name: "IERC721Errors",
|
|
316
|
-
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
317
|
-
): Promise<Contracts.IERC721Errors>;
|
|
318
351
|
deployContract(
|
|
319
352
|
name: "IERC4906",
|
|
320
353
|
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
@@ -387,6 +420,10 @@ declare module "hardhat/types/runtime" {
|
|
|
387
420
|
name: "OffboardToUserKeyTestContract",
|
|
388
421
|
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
389
422
|
): Promise<Contracts.OffboardToUserKeyTestContract>;
|
|
423
|
+
deployContract(
|
|
424
|
+
name: "ShiftTestsContract",
|
|
425
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
426
|
+
): Promise<Contracts.ShiftTestsContract>;
|
|
390
427
|
deployContract(
|
|
391
428
|
name: "StringTestsContract",
|
|
392
429
|
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
@@ -399,6 +436,30 @@ declare module "hardhat/types/runtime" {
|
|
|
399
436
|
name: "TransferTestsContract",
|
|
400
437
|
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
401
438
|
): Promise<Contracts.TransferTestsContract>;
|
|
439
|
+
deployContract(
|
|
440
|
+
name: "TransferWithAllowance64_16TestsContract",
|
|
441
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
442
|
+
): Promise<Contracts.TransferWithAllowance64_16TestsContract>;
|
|
443
|
+
deployContract(
|
|
444
|
+
name: "TransferWithAllowance64_32TestsContract",
|
|
445
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
446
|
+
): Promise<Contracts.TransferWithAllowance64_32TestsContract>;
|
|
447
|
+
deployContract(
|
|
448
|
+
name: "TransferWithAllowance64_64TestsContract",
|
|
449
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
450
|
+
): Promise<Contracts.TransferWithAllowance64_64TestsContract>;
|
|
451
|
+
deployContract(
|
|
452
|
+
name: "TransferWithAllowance64_8TestsContract",
|
|
453
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
454
|
+
): Promise<Contracts.TransferWithAllowance64_8TestsContract>;
|
|
455
|
+
deployContract(
|
|
456
|
+
name: "TransferWithAllowanceScalarTestsContract",
|
|
457
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
458
|
+
): Promise<Contracts.TransferWithAllowanceScalarTestsContract>;
|
|
459
|
+
deployContract(
|
|
460
|
+
name: "TransferWithAllowanceTestsContract",
|
|
461
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
462
|
+
): Promise<Contracts.TransferWithAllowanceTestsContract>;
|
|
402
463
|
deployContract(
|
|
403
464
|
name: "PrivateERC20WalletMock",
|
|
404
465
|
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
@@ -419,6 +480,10 @@ declare module "hardhat/types/runtime" {
|
|
|
419
480
|
name: "PrivateERC721URIStorage",
|
|
420
481
|
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
421
482
|
): Promise<Contracts.PrivateERC721URIStorage>;
|
|
483
|
+
deployContract(
|
|
484
|
+
name: "IERC721Errors",
|
|
485
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
486
|
+
): Promise<Contracts.IERC721Errors>;
|
|
422
487
|
deployContract(
|
|
423
488
|
name: "PrivateERC721",
|
|
424
489
|
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
@@ -432,21 +497,6 @@ declare module "hardhat/types/runtime" {
|
|
|
432
497
|
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
433
498
|
): Promise<Contracts.ExtendedOperations>;
|
|
434
499
|
|
|
435
|
-
deployContract(
|
|
436
|
-
name: "IERC1155Errors",
|
|
437
|
-
args: any[],
|
|
438
|
-
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
439
|
-
): Promise<Contracts.IERC1155Errors>;
|
|
440
|
-
deployContract(
|
|
441
|
-
name: "IERC20Errors",
|
|
442
|
-
args: any[],
|
|
443
|
-
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
444
|
-
): Promise<Contracts.IERC20Errors>;
|
|
445
|
-
deployContract(
|
|
446
|
-
name: "IERC721Errors",
|
|
447
|
-
args: any[],
|
|
448
|
-
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
449
|
-
): Promise<Contracts.IERC721Errors>;
|
|
450
500
|
deployContract(
|
|
451
501
|
name: "IERC4906",
|
|
452
502
|
args: any[],
|
|
@@ -537,6 +587,11 @@ declare module "hardhat/types/runtime" {
|
|
|
537
587
|
args: any[],
|
|
538
588
|
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
539
589
|
): Promise<Contracts.OffboardToUserKeyTestContract>;
|
|
590
|
+
deployContract(
|
|
591
|
+
name: "ShiftTestsContract",
|
|
592
|
+
args: any[],
|
|
593
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
594
|
+
): Promise<Contracts.ShiftTestsContract>;
|
|
540
595
|
deployContract(
|
|
541
596
|
name: "StringTestsContract",
|
|
542
597
|
args: any[],
|
|
@@ -552,6 +607,36 @@ declare module "hardhat/types/runtime" {
|
|
|
552
607
|
args: any[],
|
|
553
608
|
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
554
609
|
): Promise<Contracts.TransferTestsContract>;
|
|
610
|
+
deployContract(
|
|
611
|
+
name: "TransferWithAllowance64_16TestsContract",
|
|
612
|
+
args: any[],
|
|
613
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
614
|
+
): Promise<Contracts.TransferWithAllowance64_16TestsContract>;
|
|
615
|
+
deployContract(
|
|
616
|
+
name: "TransferWithAllowance64_32TestsContract",
|
|
617
|
+
args: any[],
|
|
618
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
619
|
+
): Promise<Contracts.TransferWithAllowance64_32TestsContract>;
|
|
620
|
+
deployContract(
|
|
621
|
+
name: "TransferWithAllowance64_64TestsContract",
|
|
622
|
+
args: any[],
|
|
623
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
624
|
+
): Promise<Contracts.TransferWithAllowance64_64TestsContract>;
|
|
625
|
+
deployContract(
|
|
626
|
+
name: "TransferWithAllowance64_8TestsContract",
|
|
627
|
+
args: any[],
|
|
628
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
629
|
+
): Promise<Contracts.TransferWithAllowance64_8TestsContract>;
|
|
630
|
+
deployContract(
|
|
631
|
+
name: "TransferWithAllowanceScalarTestsContract",
|
|
632
|
+
args: any[],
|
|
633
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
634
|
+
): Promise<Contracts.TransferWithAllowanceScalarTestsContract>;
|
|
635
|
+
deployContract(
|
|
636
|
+
name: "TransferWithAllowanceTestsContract",
|
|
637
|
+
args: any[],
|
|
638
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
639
|
+
): Promise<Contracts.TransferWithAllowanceTestsContract>;
|
|
555
640
|
deployContract(
|
|
556
641
|
name: "PrivateERC20WalletMock",
|
|
557
642
|
args: any[],
|
|
@@ -577,6 +662,11 @@ declare module "hardhat/types/runtime" {
|
|
|
577
662
|
args: any[],
|
|
578
663
|
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
579
664
|
): Promise<Contracts.PrivateERC721URIStorage>;
|
|
665
|
+
deployContract(
|
|
666
|
+
name: "IERC721Errors",
|
|
667
|
+
args: any[],
|
|
668
|
+
signerOrOptions?: ethers.Signer | DeployContractOptions
|
|
669
|
+
): Promise<Contracts.IERC721Errors>;
|
|
580
670
|
deployContract(
|
|
581
671
|
name: "PrivateERC721",
|
|
582
672
|
args: any[],
|
package/typechain-types/index.ts
CHANGED
|
@@ -6,12 +6,6 @@ export type { openzeppelin };
|
|
|
6
6
|
import type * as contracts from "./contracts";
|
|
7
7
|
export type { contracts };
|
|
8
8
|
export * as factories from "./factories";
|
|
9
|
-
export type { IERC1155Errors } from "./@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors";
|
|
10
|
-
export { IERC1155Errors__factory } from "./factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors__factory";
|
|
11
|
-
export type { IERC20Errors } from "./@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors";
|
|
12
|
-
export { IERC20Errors__factory } from "./factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors__factory";
|
|
13
|
-
export type { IERC721Errors } from "./@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors";
|
|
14
|
-
export { IERC721Errors__factory } from "./factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors__factory";
|
|
15
9
|
export type { IERC4906 } from "./@openzeppelin/contracts/interfaces/IERC4906";
|
|
16
10
|
export { IERC4906__factory } from "./factories/@openzeppelin/contracts/interfaces/IERC4906__factory";
|
|
17
11
|
export type { IERC721 } from "./@openzeppelin/contracts/token/ERC721/IERC721";
|
|
@@ -48,12 +42,26 @@ export type { MiscellaneousTestsContract } from "./contracts/mocks/utils/mpc/Mis
|
|
|
48
42
|
export { MiscellaneousTestsContract__factory } from "./factories/contracts/mocks/utils/mpc/MiscellaneousTestsContract__factory";
|
|
49
43
|
export type { OffboardToUserKeyTestContract } from "./contracts/mocks/utils/mpc/OffboardToUserKeyTestContract";
|
|
50
44
|
export { OffboardToUserKeyTestContract__factory } from "./factories/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract__factory";
|
|
45
|
+
export type { ShiftTestsContract } from "./contracts/mocks/utils/mpc/ShiftTestsContract";
|
|
46
|
+
export { ShiftTestsContract__factory } from "./factories/contracts/mocks/utils/mpc/ShiftTestsContract__factory";
|
|
51
47
|
export type { StringTestsContract } from "./contracts/mocks/utils/mpc/StringTestsContract";
|
|
52
48
|
export { StringTestsContract__factory } from "./factories/contracts/mocks/utils/mpc/StringTestsContract__factory";
|
|
53
49
|
export type { TransferScalarTestsContract } from "./contracts/mocks/utils/mpc/TransferScalarTestsContract";
|
|
54
50
|
export { TransferScalarTestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferScalarTestsContract__factory";
|
|
55
51
|
export type { TransferTestsContract } from "./contracts/mocks/utils/mpc/TransferTestsContract";
|
|
56
52
|
export { TransferTestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferTestsContract__factory";
|
|
53
|
+
export type { TransferWithAllowance64_16TestsContract } from "./contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract";
|
|
54
|
+
export { TransferWithAllowance64_16TestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract__factory";
|
|
55
|
+
export type { TransferWithAllowance64_32TestsContract } from "./contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract";
|
|
56
|
+
export { TransferWithAllowance64_32TestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract__factory";
|
|
57
|
+
export type { TransferWithAllowance64_64TestsContract } from "./contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract";
|
|
58
|
+
export { TransferWithAllowance64_64TestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract__factory";
|
|
59
|
+
export type { TransferWithAllowance64_8TestsContract } from "./contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract";
|
|
60
|
+
export { TransferWithAllowance64_8TestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract__factory";
|
|
61
|
+
export type { TransferWithAllowanceScalarTestsContract } from "./contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract";
|
|
62
|
+
export { TransferWithAllowanceScalarTestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract__factory";
|
|
63
|
+
export type { TransferWithAllowanceTestsContract } from "./contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract";
|
|
64
|
+
export { TransferWithAllowanceTestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract__factory";
|
|
57
65
|
export type { PrivateERC20WalletMock } from "./contracts/mocks/wallet/PrivateERC20Wallet/PrivateERC20WalletMock";
|
|
58
66
|
export { PrivateERC20WalletMock__factory } from "./factories/contracts/mocks/wallet/PrivateERC20Wallet/PrivateERC20WalletMock__factory";
|
|
59
67
|
export type { AccountOnboard } from "./contracts/onboard/AccountOnboard";
|
|
@@ -64,6 +72,8 @@ export type { PrivateERC20 } from "./contracts/token/PrivateERC20/PrivateERC20";
|
|
|
64
72
|
export { PrivateERC20__factory } from "./factories/contracts/token/PrivateERC20/PrivateERC20__factory";
|
|
65
73
|
export type { PrivateERC721URIStorage } from "./contracts/token/PrivateERC721/extensions/PrivateERC721URIStorage";
|
|
66
74
|
export { PrivateERC721URIStorage__factory } from "./factories/contracts/token/PrivateERC721/extensions/PrivateERC721URIStorage__factory";
|
|
75
|
+
export type { IERC721Errors } from "./contracts/token/PrivateERC721/IERC721Errors";
|
|
76
|
+
export { IERC721Errors__factory } from "./factories/contracts/token/PrivateERC721/IERC721Errors__factory";
|
|
67
77
|
export type { PrivateERC721 } from "./contracts/token/PrivateERC721/PrivateERC721";
|
|
68
78
|
export { PrivateERC721__factory } from "./factories/contracts/token/PrivateERC721/PrivateERC721__factory";
|
|
69
79
|
export type { MpcCore } from "./contracts/utils/mpc/MpcCore";
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# DataPrivacyFramework
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
The `DataPrivacyFramework` is an abstract Solidity contract designed to manage conditions and operations related to data privacy. The contract handles operations such as user permissions, time-bound constraints, and condition validation based on various keys and parameters.
|
|
6
|
-
|
|
7
|
-
## Prerequisites
|
|
8
|
-
|
|
9
|
-
- **Solidity Version:** `^0.8.19`
|
|
10
|
-
- **License:** MIT
|
|
11
|
-
|
|
12
|
-
## Table of Contents
|
|
13
|
-
- [Data Structures](#data-structures)
|
|
14
|
-
- [InputData Struct](#inputdata-struct)
|
|
15
|
-
- [Condition Struct](#condition-struct)
|
|
16
|
-
- [Functions](#functions)
|
|
17
|
-
- [Abstract Functions](#abstract-functions)
|
|
18
|
-
|
|
19
|
-
## Data Structures
|
|
20
|
-
|
|
21
|
-
### InputData Struct
|
|
22
|
-
|
|
23
|
-
The `InputData` struct is a data holder that encapsulates the details of a particular operation or action requested by the caller. This struct helps in preventing the "stack too deep" error, which occurs when a function has too many local variables.
|
|
24
|
-
|
|
25
|
-
#### Fields:
|
|
26
|
-
- **`caller`**: (`address`) The address of the user or contract initiating the operation.
|
|
27
|
-
- **`operation`**: (`string`) The name or type of the operation being executed.
|
|
28
|
-
- **`active`**: (`bool`) A boolean flag indicating whether the operation is currently active.
|
|
29
|
-
- **`timestampBefore`**: (`uint256`) The operation must be executed before this timestamp.
|
|
30
|
-
- **`timestampAfter`**: (`uint256`) The operation must be executed after this timestamp.
|
|
31
|
-
- **`falseKey`**: (`bool`) A boolean flag that, if true, makes the condition unsatisfiable.
|
|
32
|
-
- **`trueKey`**: (`bool`) A boolean flag that, if true, makes the condition always satisfied (unless `falseKey` is true).
|
|
33
|
-
- **`uintParameter`**: (`uint256`) A numerical parameter relevant to the operation.
|
|
34
|
-
- **`addressParameter`**: (`address`) An address that may be used as a parameter for the operation.
|
|
35
|
-
- **`stringParameter`**: (`string`) A string-based parameter used for additional details in the operation.
|
|
36
|
-
|
|
37
|
-
### Condition Struct
|
|
38
|
-
|
|
39
|
-
The `Condition` struct represents a privacy-related condition that can either permit or deny an operation based on various factors, such as the caller, timing constraints, and control flags (`falseKey`, `trueKey`).
|
|
40
|
-
|
|
41
|
-
#### Fields:
|
|
42
|
-
- **`id`**: (`uint256`) A unique identifier for the condition.
|
|
43
|
-
- **`caller`**: (`address`) The address associated with the condition.
|
|
44
|
-
- **`operation`**: (`string`) The type of operation the condition governs.
|
|
45
|
-
- **`active`**: (`bool`) Indicates if the condition is currently valid or active.
|
|
46
|
-
- **`falseKey`**: (`bool`) If set to `true`, the condition will never be satisfied.
|
|
47
|
-
- **`trueKey`**: (`bool`) If set to `true`, the condition will always be satisfied (unless `falseKey` is also true).
|
|
48
|
-
- **`timestampBefore`**: (`uint256`) The condition is only valid before this timestamp.
|
|
49
|
-
- **`timestampAfter`**: (`uint256`) The condition is only valid after this timestamp.
|
|
50
|
-
|
|
51
|
-
## Functions
|
|
52
|
-
|
|
53
|
-
### Abstract Functions
|
|
54
|
-
|
|
55
|
-
The contract is abstract, so the following functions are likely declared but not implemented within this contract. They need to be implemented in derived contracts.
|
|
56
|
-
|
|
57
|
-
#### `checkCondition`
|
|
58
|
-
This function checks whether the conditions of a specific operation are met, based on the values in the `Condition` struct.
|
|
59
|
-
|
|
60
|
-
```solidity
|
|
61
|
-
function checkCondition(uint256 conditionId) public view virtual returns (bool);
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
- **Parameters**:
|
|
65
|
-
- `conditionId`: The unique ID of the condition to check.
|
|
66
|
-
|
|
67
|
-
- **Returns**:
|
|
68
|
-
- `bool`: `true` if the condition is satisfied, `false` otherwise.
|