@coti-io/coti-contracts 1.0.0 → 1.0.2

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.
Files changed (88) hide show
  1. package/.github/workflows/npm-publish.yml +2 -1
  2. package/CONTRIBUTING.md +2 -2
  3. package/LICENSE +1 -1
  4. package/README.md +18 -35
  5. package/contracts/mocks/utils/mpc/ArithmeticTestsContract.sol +152 -0
  6. package/contracts/mocks/utils/mpc/BitwiseTestsContract.sol +11 -1
  7. package/contracts/mocks/utils/mpc/Comparison2TestsContract.sol +8 -0
  8. package/contracts/mocks/utils/mpc/Miscellaneous1TestsContract.sol +33 -4
  9. package/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract.sol +35 -10
  10. package/contracts/mocks/utils/mpc/TransferTestsContract.sol +3 -0
  11. package/contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract.sol +222 -0
  12. package/contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract.sol +222 -0
  13. package/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol +223 -0
  14. package/contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract.sol +222 -0
  15. package/contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract.sol +265 -0
  16. package/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol +281 -0
  17. package/contracts/token/PrivateERC20/PrivateERC20.sol +1 -1
  18. package/contracts/token/PrivateERC721/IERC721Errors.sol +57 -0
  19. package/contracts/token/PrivateERC721/PrivateERC721.sol +1 -1
  20. package/hardhat.config.ts +9 -1
  21. package/package.json +20 -4
  22. package/test/token/PrivateERC20/PrivateERC20.test.ts +2 -2
  23. package/test/utils/mpc/Precompile.test.ts +16 -2
  24. package/typechain-types/contracts/mocks/utils/mpc/ArithmeticTestsContract.ts +66 -0
  25. package/typechain-types/contracts/mocks/utils/mpc/BitwiseTestsContract.ts +6 -0
  26. package/typechain-types/contracts/mocks/utils/mpc/Comparison2TestsContract.ts +6 -0
  27. package/typechain-types/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract.ts +36 -6
  28. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/TransferWithAllowance64TestsContract.ts +251 -0
  29. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/TransferWithAllowanceTestsContract.ts +250 -0
  30. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/index.ts +5 -0
  31. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.ts +389 -0
  32. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract.ts +391 -0
  33. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract.ts +391 -0
  34. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/TransferWithAllowance64_64TestsContract.ts +391 -0
  35. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/TransferWithAllowance64_8TestsContract.ts +391 -0
  36. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/index.ts +5 -0
  37. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.ts +391 -0
  38. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract.ts +391 -0
  39. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract.ts +306 -0
  40. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/TransferTestsContract.ts +125 -0
  41. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/TransferWithAllowanceTestsContract.ts +125 -0
  42. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/index.ts +5 -0
  43. package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.ts +296 -0
  44. package/typechain-types/contracts/mocks/utils/mpc/index.ts +6 -0
  45. package/typechain-types/contracts/token/PrivateERC721/IERC721Errors.ts +69 -0
  46. package/typechain-types/contracts/token/PrivateERC721/index.ts +1 -0
  47. package/typechain-types/factories/contracts/mocks/access/DataPrivacyFramework/DataPrivacyFrameworkMock__factory.ts +1 -1
  48. package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20Mock__factory.ts +1 -1
  49. package/typechain-types/factories/contracts/mocks/token/PrivateERC721/PrivateERC721URIStorageMock__factory.ts +1 -1
  50. package/typechain-types/factories/contracts/mocks/utils/mpc/ArithmeticTestsContract__factory.ts +73 -1
  51. package/typechain-types/factories/contracts/mocks/utils/mpc/BitwiseTestsContract__factory.ts +11 -1
  52. package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison1TestsContract__factory.ts +1 -1
  53. package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison2TestsContract__factory.ts +11 -1
  54. package/typechain-types/factories/contracts/mocks/utils/mpc/MinMaxTestsContract__factory.ts +1 -1
  55. package/typechain-types/factories/contracts/mocks/utils/mpc/Miscellaneous1TestsContract__factory.ts +1 -1
  56. package/typechain-types/factories/contracts/mocks/utils/mpc/MiscellaneousTestsContract__factory.ts +1 -1
  57. package/typechain-types/factories/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract__factory.ts +26 -30
  58. package/typechain-types/factories/contracts/mocks/utils/mpc/StringTestsContract__factory.ts +1 -1
  59. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferScalarTestsContract__factory.ts +1 -1
  60. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferTestsContract__factory.ts +1 -1
  61. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/TransferWithAllowance64TestsContract__factory.ts +294 -0
  62. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/TransferWithAllowanceTestsContract__factory.ts +292 -0
  63. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/index.ts +5 -0
  64. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract__factory.ts +720 -0
  65. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract__factory.ts +724 -0
  66. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract__factory.ts +724 -0
  67. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/TransferWithAllowance64_64TestsContract__factory.ts +724 -0
  68. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/TransferWithAllowance64_8TestsContract__factory.ts +724 -0
  69. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/index.ts +5 -0
  70. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract__factory.ts +724 -0
  71. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract__factory.ts +724 -0
  72. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract__factory.ts +507 -0
  73. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/TransferTestsContract__factory.ts +150 -0
  74. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/TransferWithAllowanceTestsContract__factory.ts +150 -0
  75. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/index.ts +5 -0
  76. package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract__factory.ts +434 -0
  77. package/typechain-types/factories/contracts/mocks/utils/mpc/index.ts +6 -0
  78. package/typechain-types/factories/contracts/mocks/wallet/PrivateERC20Wallet/PrivateERC20WalletMock__factory.ts +1 -1
  79. package/typechain-types/factories/contracts/onboard/AccountOnboard__factory.ts +1 -1
  80. package/typechain-types/factories/contracts/token/PrivateERC721/IERC721Errors__factory.ts +128 -0
  81. package/typechain-types/factories/contracts/token/PrivateERC721/index.ts +1 -0
  82. package/typechain-types/factories/contracts/utils/mpc/MpcCore__factory.ts +1 -1
  83. package/typechain-types/hardhat.d.ts +126 -0
  84. package/typechain-types/index.ts +12 -0
  85. package/contracts/access/DataPrivacyFramework/README.md +0 -68
  86. package/contracts/token/PrivateERC20/README.md +0 -104
  87. package/contracts/token/PrivateERC721/README.md +0 -282
  88. 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
+ }
@@ -2,4 +2,5 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  export * as extensions from "./extensions";
5
+ export { IERC721Errors__factory } from "./IERC721Errors__factory";
5
6
  export { PrivateERC721__factory } from "./PrivateERC721__factory";
@@ -31,7 +31,7 @@ const _abi = [
31
31
  ] as const;
32
32
 
33
33
  const _bytecode =
34
- "0x60be610052600b82828239805160001a607314610045577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361060335760003560e01c806331b943d5146038575b600080fd5b603e6052565b60405160499190606f565b60405180910390f35b61010081565b6000819050919050565b6069816058565b82525050565b6000602082019050608260008301846062565b9291505056fea26469706673582212209f44aef4fba9031e980e1bcc12c4a31201c765e5b9e76c8e0f7bc33f7ff7b7c864736f6c63430008140033";
34
+ "0x6088610038600b82828239805160001a607314602b57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361060335760003560e01c806331b943d5146038575b600080fd5b604061010081565b60405190815260200160405180910390f3fea26469706673582212206dadde1d79710197e10197637f9b02aadeabab1cb2acdebea5688b628b867a0464736f6c63430008130033";
35
35
 
36
36
  type MpcCoreConstructorParams =
37
37
  | [signer?: Signer]
@@ -109,6 +109,30 @@ declare module "hardhat/types/runtime" {
109
109
  name: "TransferTestsContract",
110
110
  signerOrOptions?: ethers.Signer | FactoryOptions
111
111
  ): Promise<Contracts.TransferTestsContract__factory>;
112
+ getContractFactory(
113
+ name: "TransferWithAllowance64_16TestsContract",
114
+ signerOrOptions?: ethers.Signer | FactoryOptions
115
+ ): Promise<Contracts.TransferWithAllowance64_16TestsContract__factory>;
116
+ getContractFactory(
117
+ name: "TransferWithAllowance64_32TestsContract",
118
+ signerOrOptions?: ethers.Signer | FactoryOptions
119
+ ): Promise<Contracts.TransferWithAllowance64_32TestsContract__factory>;
120
+ getContractFactory(
121
+ name: "TransferWithAllowance64_64TestsContract",
122
+ signerOrOptions?: ethers.Signer | FactoryOptions
123
+ ): Promise<Contracts.TransferWithAllowance64_64TestsContract__factory>;
124
+ getContractFactory(
125
+ name: "TransferWithAllowance64_8TestsContract",
126
+ signerOrOptions?: ethers.Signer | FactoryOptions
127
+ ): Promise<Contracts.TransferWithAllowance64_8TestsContract__factory>;
128
+ getContractFactory(
129
+ name: "TransferWithAllowanceScalarTestsContract",
130
+ signerOrOptions?: ethers.Signer | FactoryOptions
131
+ ): Promise<Contracts.TransferWithAllowanceScalarTestsContract__factory>;
132
+ getContractFactory(
133
+ name: "TransferWithAllowanceTestsContract",
134
+ signerOrOptions?: ethers.Signer | FactoryOptions
135
+ ): Promise<Contracts.TransferWithAllowanceTestsContract__factory>;
112
136
  getContractFactory(
113
137
  name: "PrivateERC20WalletMock",
114
138
  signerOrOptions?: ethers.Signer | FactoryOptions
@@ -129,6 +153,10 @@ declare module "hardhat/types/runtime" {
129
153
  name: "PrivateERC721URIStorage",
130
154
  signerOrOptions?: ethers.Signer | FactoryOptions
131
155
  ): Promise<Contracts.PrivateERC721URIStorage__factory>;
156
+ getContractFactory(
157
+ name: "IERC721Errors",
158
+ signerOrOptions?: ethers.Signer | FactoryOptions
159
+ ): Promise<Contracts.IERC721Errors__factory>;
132
160
  getContractFactory(
133
161
  name: "PrivateERC721",
134
162
  signerOrOptions?: ethers.Signer | FactoryOptions
@@ -262,6 +290,36 @@ declare module "hardhat/types/runtime" {
262
290
  address: string | ethers.Addressable,
263
291
  signer?: ethers.Signer
264
292
  ): Promise<Contracts.TransferTestsContract>;
293
+ getContractAt(
294
+ name: "TransferWithAllowance64_16TestsContract",
295
+ address: string | ethers.Addressable,
296
+ signer?: ethers.Signer
297
+ ): Promise<Contracts.TransferWithAllowance64_16TestsContract>;
298
+ getContractAt(
299
+ name: "TransferWithAllowance64_32TestsContract",
300
+ address: string | ethers.Addressable,
301
+ signer?: ethers.Signer
302
+ ): Promise<Contracts.TransferWithAllowance64_32TestsContract>;
303
+ getContractAt(
304
+ name: "TransferWithAllowance64_64TestsContract",
305
+ address: string | ethers.Addressable,
306
+ signer?: ethers.Signer
307
+ ): Promise<Contracts.TransferWithAllowance64_64TestsContract>;
308
+ getContractAt(
309
+ name: "TransferWithAllowance64_8TestsContract",
310
+ address: string | ethers.Addressable,
311
+ signer?: ethers.Signer
312
+ ): Promise<Contracts.TransferWithAllowance64_8TestsContract>;
313
+ getContractAt(
314
+ name: "TransferWithAllowanceScalarTestsContract",
315
+ address: string | ethers.Addressable,
316
+ signer?: ethers.Signer
317
+ ): Promise<Contracts.TransferWithAllowanceScalarTestsContract>;
318
+ getContractAt(
319
+ name: "TransferWithAllowanceTestsContract",
320
+ address: string | ethers.Addressable,
321
+ signer?: ethers.Signer
322
+ ): Promise<Contracts.TransferWithAllowanceTestsContract>;
265
323
  getContractAt(
266
324
  name: "PrivateERC20WalletMock",
267
325
  address: string | ethers.Addressable,
@@ -287,6 +345,11 @@ declare module "hardhat/types/runtime" {
287
345
  address: string | ethers.Addressable,
288
346
  signer?: ethers.Signer
289
347
  ): Promise<Contracts.PrivateERC721URIStorage>;
348
+ getContractAt(
349
+ name: "IERC721Errors",
350
+ address: string | ethers.Addressable,
351
+ signer?: ethers.Signer
352
+ ): Promise<Contracts.IERC721Errors>;
290
353
  getContractAt(
291
354
  name: "PrivateERC721",
292
355
  address: string | ethers.Addressable,
@@ -399,6 +462,30 @@ declare module "hardhat/types/runtime" {
399
462
  name: "TransferTestsContract",
400
463
  signerOrOptions?: ethers.Signer | DeployContractOptions
401
464
  ): Promise<Contracts.TransferTestsContract>;
465
+ deployContract(
466
+ name: "TransferWithAllowance64_16TestsContract",
467
+ signerOrOptions?: ethers.Signer | DeployContractOptions
468
+ ): Promise<Contracts.TransferWithAllowance64_16TestsContract>;
469
+ deployContract(
470
+ name: "TransferWithAllowance64_32TestsContract",
471
+ signerOrOptions?: ethers.Signer | DeployContractOptions
472
+ ): Promise<Contracts.TransferWithAllowance64_32TestsContract>;
473
+ deployContract(
474
+ name: "TransferWithAllowance64_64TestsContract",
475
+ signerOrOptions?: ethers.Signer | DeployContractOptions
476
+ ): Promise<Contracts.TransferWithAllowance64_64TestsContract>;
477
+ deployContract(
478
+ name: "TransferWithAllowance64_8TestsContract",
479
+ signerOrOptions?: ethers.Signer | DeployContractOptions
480
+ ): Promise<Contracts.TransferWithAllowance64_8TestsContract>;
481
+ deployContract(
482
+ name: "TransferWithAllowanceScalarTestsContract",
483
+ signerOrOptions?: ethers.Signer | DeployContractOptions
484
+ ): Promise<Contracts.TransferWithAllowanceScalarTestsContract>;
485
+ deployContract(
486
+ name: "TransferWithAllowanceTestsContract",
487
+ signerOrOptions?: ethers.Signer | DeployContractOptions
488
+ ): Promise<Contracts.TransferWithAllowanceTestsContract>;
402
489
  deployContract(
403
490
  name: "PrivateERC20WalletMock",
404
491
  signerOrOptions?: ethers.Signer | DeployContractOptions
@@ -419,6 +506,10 @@ declare module "hardhat/types/runtime" {
419
506
  name: "PrivateERC721URIStorage",
420
507
  signerOrOptions?: ethers.Signer | DeployContractOptions
421
508
  ): Promise<Contracts.PrivateERC721URIStorage>;
509
+ deployContract(
510
+ name: "IERC721Errors",
511
+ signerOrOptions?: ethers.Signer | DeployContractOptions
512
+ ): Promise<Contracts.IERC721Errors>;
422
513
  deployContract(
423
514
  name: "PrivateERC721",
424
515
  signerOrOptions?: ethers.Signer | DeployContractOptions
@@ -552,6 +643,36 @@ declare module "hardhat/types/runtime" {
552
643
  args: any[],
553
644
  signerOrOptions?: ethers.Signer | DeployContractOptions
554
645
  ): Promise<Contracts.TransferTestsContract>;
646
+ deployContract(
647
+ name: "TransferWithAllowance64_16TestsContract",
648
+ args: any[],
649
+ signerOrOptions?: ethers.Signer | DeployContractOptions
650
+ ): Promise<Contracts.TransferWithAllowance64_16TestsContract>;
651
+ deployContract(
652
+ name: "TransferWithAllowance64_32TestsContract",
653
+ args: any[],
654
+ signerOrOptions?: ethers.Signer | DeployContractOptions
655
+ ): Promise<Contracts.TransferWithAllowance64_32TestsContract>;
656
+ deployContract(
657
+ name: "TransferWithAllowance64_64TestsContract",
658
+ args: any[],
659
+ signerOrOptions?: ethers.Signer | DeployContractOptions
660
+ ): Promise<Contracts.TransferWithAllowance64_64TestsContract>;
661
+ deployContract(
662
+ name: "TransferWithAllowance64_8TestsContract",
663
+ args: any[],
664
+ signerOrOptions?: ethers.Signer | DeployContractOptions
665
+ ): Promise<Contracts.TransferWithAllowance64_8TestsContract>;
666
+ deployContract(
667
+ name: "TransferWithAllowanceScalarTestsContract",
668
+ args: any[],
669
+ signerOrOptions?: ethers.Signer | DeployContractOptions
670
+ ): Promise<Contracts.TransferWithAllowanceScalarTestsContract>;
671
+ deployContract(
672
+ name: "TransferWithAllowanceTestsContract",
673
+ args: any[],
674
+ signerOrOptions?: ethers.Signer | DeployContractOptions
675
+ ): Promise<Contracts.TransferWithAllowanceTestsContract>;
555
676
  deployContract(
556
677
  name: "PrivateERC20WalletMock",
557
678
  args: any[],
@@ -577,6 +698,11 @@ declare module "hardhat/types/runtime" {
577
698
  args: any[],
578
699
  signerOrOptions?: ethers.Signer | DeployContractOptions
579
700
  ): Promise<Contracts.PrivateERC721URIStorage>;
701
+ deployContract(
702
+ name: "IERC721Errors",
703
+ args: any[],
704
+ signerOrOptions?: ethers.Signer | DeployContractOptions
705
+ ): Promise<Contracts.IERC721Errors>;
580
706
  deployContract(
581
707
  name: "PrivateERC721",
582
708
  args: any[],
@@ -54,6 +54,18 @@ export type { TransferScalarTestsContract } from "./contracts/mocks/utils/mpc/Tr
54
54
  export { TransferScalarTestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferScalarTestsContract__factory";
55
55
  export type { TransferTestsContract } from "./contracts/mocks/utils/mpc/TransferTestsContract";
56
56
  export { TransferTestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferTestsContract__factory";
57
+ export type { TransferWithAllowance64_16TestsContract } from "./contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract";
58
+ export { TransferWithAllowance64_16TestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract__factory";
59
+ export type { TransferWithAllowance64_32TestsContract } from "./contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract";
60
+ export { TransferWithAllowance64_32TestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract__factory";
61
+ export type { TransferWithAllowance64_64TestsContract } from "./contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract";
62
+ export { TransferWithAllowance64_64TestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract__factory";
63
+ export type { TransferWithAllowance64_8TestsContract } from "./contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract";
64
+ export { TransferWithAllowance64_8TestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract__factory";
65
+ export type { TransferWithAllowanceScalarTestsContract } from "./contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract";
66
+ export { TransferWithAllowanceScalarTestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract__factory";
67
+ export type { TransferWithAllowanceTestsContract } from "./contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract";
68
+ export { TransferWithAllowanceTestsContract__factory } from "./factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract__factory";
57
69
  export type { PrivateERC20WalletMock } from "./contracts/mocks/wallet/PrivateERC20Wallet/PrivateERC20WalletMock";
58
70
  export { PrivateERC20WalletMock__factory } from "./factories/contracts/mocks/wallet/PrivateERC20Wallet/PrivateERC20WalletMock__factory";
59
71
  export type { AccountOnboard } from "./contracts/onboard/AccountOnboard";
@@ -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.
@@ -1,104 +0,0 @@
1
- # PrivateERC20
2
-
3
- ## Overview
4
-
5
- The `PrivateERC20` contract is an abstract implementation of a privacy-enhanced ERC20 token. It introduces mechanisms for handling encrypted addresses and balances, allowing for more secure and private token transfers. This contract builds on top of OpenZeppelin's `Context` and the `IPrivateERC20` interface, and it integrates with the `MpcCore` library for secure multiparty computation (MPC).
6
-
7
- ## Prerequisites
8
-
9
- - **Solidity Version**: `^0.8.19`
10
- - **License**: MIT
11
- - **Dependencies**:
12
- - OpenZeppelin's `Context` contract
13
- - Interface `IPrivateERC20`
14
- - Utility `MpcCore` for cryptographic operations.
15
-
16
- ## Table of Contents
17
- - [Constants](#constants)
18
- - [MAX_UINT_64](#max_uint_64)
19
- - [State Variables](#state-variables)
20
- - [Account Encryption Address Mapping](#account-encryption-address-mapping)
21
- - [Balance Mapping](#balance-mapping)
22
- - [Allowances Mapping](#allowances-mapping)
23
- - [Total Supply](#total-supply)
24
- - [Token Name and Symbol](#token-name-and-symbol)
25
- - [Errors](#errors)
26
- - [ERC20InvalidSender](#erc20invalidsender)
27
- - [ERC20InvalidReceiver](#erc20invalidreceiver)
28
- - [Functions](#functions)
29
- - To be documented as additional logic is discovered.
30
-
31
- ## Constants
32
-
33
- ### MAX_UINT_64
34
-
35
- ```solidity
36
- uint64 private constant MAX_UINT_64 = type(uint64).max;
37
- ```
38
-
39
- The constant `MAX_UINT_64` represents the maximum value of a 64-bit unsigned integer. This is used as a cap for various operations in the contract.
40
-
41
- ## State Variables
42
-
43
- ### Account Encryption Address Mapping
44
-
45
- ```solidity
46
- mapping(address account => address) private _accountEncryptionAddress;
47
- ```
48
-
49
- This mapping associates each account (public address) with an encryption address. The encryption address could be used for handling cryptographically secure operations involving private balances and transactions.
50
-
51
- ### Balance Mapping
52
-
53
- ```solidity
54
- mapping(address account => utUint64) private _balances;
55
- ```
56
-
57
- The `_balances` mapping keeps track of each account's token balance, but it uses a 64-bit unsigned integer (`utUint64`). This might be intended for scaling or privacy-preserving reasons.
58
-
59
- ### Allowances Mapping
60
-
61
- ```solidity
62
- mapping(address account => mapping(address spender => Allowance)) private _allowances;
63
- ```
64
-
65
- The `_allowances` mapping tracks the allowance that one account (`account`) has given to another account (`spender`). This is a standard ERC20 allowance mechanism with the added layer of the `Allowance` structure, which may handle encrypted or privacy-preserving amounts.
66
-
67
- ### Total Supply
68
-
69
- ```solidity
70
- ctUint64 private _totalSupply;
71
- ```
72
-
73
- The `_totalSupply` variable keeps track of the total number of tokens in existence. Like the `_balances` mapping, it uses a 64-bit unsigned integer (`ctUint64`).
74
-
75
- ### Token Name and Symbol
76
-
77
- ```solidity
78
- string private _name;
79
- string private _symbol;
80
- ```
81
-
82
- These variables store the name and symbol of the token, following the ERC20 standard.
83
-
84
- ## Errors
85
-
86
- ### ERC20InvalidSender
87
-
88
- ```solidity
89
- error ERC20InvalidSender(address sender);
90
- ```
91
-
92
- The `ERC20InvalidSender` error is raised when an invalid sender address attempts to perform a token transfer. It logs the `sender` address that caused the failure.
93
-
94
- ### ERC20InvalidReceiver
95
-
96
- ```solidity
97
- error ERC20InvalidReceiver(address receiver);
98
- ```
99
-
100
- The `ERC20InvalidReceiver` error is raised when a transfer fails due to an invalid receiver address. It logs the `receiver` address that caused the failure.
101
-
102
- ## Functions
103
-
104
- Functions in the contract are abstract or unimplemented in this fragment. These likely involve ERC20-style operations, such as `transfer`, `approve`, and `transferFrom`, but with privacy-preserving adjustments, including the handling of encrypted addresses and balances.