@coti-io/coti-contracts 0.1.0 → 1.0.0
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/contracts/access/DataPrivacyFramework/extensions/DataPrivacyFrameworkMpc.sol +3 -115
- package/contracts/mocks/README.md +1 -1
- package/contracts/mocks/utils/mpc/ArithmeticTestsContract.sol +105 -280
- package/contracts/mocks/utils/mpc/BitwiseTestsContract.sol +83 -187
- package/contracts/mocks/utils/mpc/{Comparison1Tests.Contract.sol → Comparison1TestsContract.sol} +67 -115
- package/contracts/mocks/utils/mpc/Comparison2TestsContract.sol +68 -116
- package/contracts/mocks/utils/mpc/MinMaxTestsContract.sol +69 -164
- package/contracts/mocks/utils/mpc/Miscellaneous1TestsContract.sol +70 -52
- package/contracts/mocks/utils/mpc/MiscellaneousTestsContract.sol +270 -0
- package/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract.sol +102 -0
- package/contracts/mocks/utils/mpc/README.md +12 -12
- package/contracts/mocks/utils/mpc/TransferScalarTestsContract.sol +54 -211
- package/contracts/mocks/utils/mpc/TransferTestsContract.sol +162 -640
- package/contracts/onboard/AccountOnboard.sol +3 -3
- package/contracts/utils/mpc/MpcCore.sol +2835 -988
- package/contracts/utils/mpc/MpcInterface.sol +6 -4
- package/hardhat.config.ts +8 -5
- package/package.json +2 -2
- package/test/utils/accounts.ts +1 -1
- package/test/utils/mpc/Precompile.test.ts +26 -37
- package/typechain-types/contracts/mocks/utils/mpc/ArithmeticTestsContract.sol/ArithmeticTestsContract.ts +374 -0
- package/typechain-types/contracts/mocks/utils/mpc/ArithmeticTestsContract.sol/PrecompilesArythmeticTestsContract.ts +374 -0
- package/typechain-types/contracts/mocks/utils/mpc/ArithmeticTestsContract.sol/index.ts +5 -0
- package/typechain-types/contracts/mocks/utils/mpc/ArithmeticTestsContract.ts +30 -10
- package/typechain-types/contracts/mocks/utils/mpc/BitwiseTestsContract.ts +39 -5
- package/typechain-types/contracts/mocks/utils/mpc/Comparison1TestsContract.ts +374 -0
- package/typechain-types/contracts/mocks/utils/mpc/Comparison2TestsContract.ts +39 -5
- package/typechain-types/contracts/mocks/utils/mpc/MinMaxTestsContract.ts +25 -5
- package/typechain-types/contracts/mocks/utils/mpc/Miscellaneous1TestsContract.ts +62 -0
- package/typechain-types/contracts/mocks/utils/mpc/MiscellaneousTestsContract.ts +396 -0
- package/typechain-types/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract.ts +221 -0
- package/typechain-types/contracts/mocks/utils/mpc/OffboardToUserKeyTestsContract.sol/OffboardToUserKeyTestContract.ts +11 -8
- package/typechain-types/contracts/mocks/utils/mpc/TransferScalarTestsContract.ts +15 -15
- package/typechain-types/contracts/mocks/utils/mpc/TransferTestsContract.ts +15 -15
- package/typechain-types/contracts/mocks/utils/mpc/index.ts +3 -6
- package/typechain-types/contracts/onboard/AccountOnboard.ts +9 -4
- package/typechain-types/contracts/utils/mpc/MpcCore.ts +84 -0
- package/typechain-types/contracts/utils/mpc/MpcInterface.sol/ExtendedOperations.ts +81 -40
- package/typechain-types/contracts/utils/mpc/index.ts +1 -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.sol/ArithmeticTestsContract__factory.ts +387 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/ArithmeticTestsContract.sol/PrecompilesArythmeticTestsContract__factory.ts +388 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/ArithmeticTestsContract.sol/index.ts +5 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/ArithmeticTestsContract__factory.ts +20 -7
- package/typechain-types/factories/contracts/mocks/utils/mpc/BitwiseTestsContract__factory.ts +28 -2
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison1Tests.Contract.sol/Comparison1TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison1TestsContract__factory.ts +387 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison2TestsContract__factory.ts +28 -2
- package/typechain-types/factories/contracts/mocks/utils/mpc/MinMaxTestsContract__factory.ts +15 -2
- package/typechain-types/factories/contracts/mocks/utils/mpc/Miscellaneous1TestsContract__factory.ts +66 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Miscellaneous2TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/MiscellaneousTestsContract__factory.ts +424 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract__factory.ts +289 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/OffboardToUserKeyTestsContract.sol/OffboardToUserKeyTestContract__factory.ts +19 -3
- 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 +4 -4
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferTestsContract__factory.ts +4 -4
- package/typechain-types/factories/contracts/mocks/utils/mpc/index.ts +3 -4
- package/typechain-types/factories/contracts/mocks/wallet/PrivateERC20Wallet/PrivateERC20WalletMock__factory.ts +1 -1
- package/typechain-types/factories/contracts/onboard/AccountOnboard__factory.ts +8 -2
- package/typechain-types/factories/contracts/utils/mpc/MpcCore__factory.ts +77 -0
- package/typechain-types/factories/contracts/utils/mpc/MpcInterface.sol/ExtendedOperations__factory.ts +124 -61
- package/typechain-types/factories/contracts/utils/mpc/index.ts +1 -0
- package/typechain-types/hardhat.d.ts +26 -26
- package/typechain-types/index.ts +8 -8
- package/contracts/mocks/utils/mpc/Miscellaneous2TestsContract.sol +0 -448
- package/contracts/mocks/utils/mpc/OffboardToUserKeyTestsContract.sol +0 -81
- package/contracts/mocks/utils/mpc/ShiftTestsContract.sol +0 -311
|
@@ -48,7 +48,7 @@ abstract contract DataPrivacyFrameworkMpc is DataPrivacyFramework {
|
|
|
48
48
|
)
|
|
49
49
|
internal
|
|
50
50
|
onlyAllowedUserOperation("op_mul", uintParameter, addressParameter, stringParameter)
|
|
51
|
-
returns (
|
|
51
|
+
returns (gtUint8)
|
|
52
52
|
{
|
|
53
53
|
return MpcCore.mul(a, b);
|
|
54
54
|
}
|
|
@@ -123,34 +123,6 @@ abstract contract DataPrivacyFrameworkMpc is DataPrivacyFramework {
|
|
|
123
123
|
return MpcCore.xor(a, b);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
function shl(
|
|
127
|
-
gtUint8 a,
|
|
128
|
-
gtUint8 b,
|
|
129
|
-
uint256 uintParameter,
|
|
130
|
-
address addressParameter,
|
|
131
|
-
string calldata stringParameter
|
|
132
|
-
)
|
|
133
|
-
internal
|
|
134
|
-
onlyAllowedUserOperation("op_shl", uintParameter, addressParameter, stringParameter)
|
|
135
|
-
returns (gtUint8)
|
|
136
|
-
{
|
|
137
|
-
return MpcCore.shl(a, b);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function shr(
|
|
141
|
-
gtUint8 a,
|
|
142
|
-
gtUint8 b,
|
|
143
|
-
uint256 uintParameter,
|
|
144
|
-
address addressParameter,
|
|
145
|
-
string calldata stringParameter
|
|
146
|
-
)
|
|
147
|
-
internal
|
|
148
|
-
onlyAllowedUserOperation("op_shr", uintParameter, addressParameter, stringParameter)
|
|
149
|
-
returns (gtUint8)
|
|
150
|
-
{
|
|
151
|
-
return MpcCore.shr(a, b);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
126
|
function eq(
|
|
155
127
|
gtUint8 a,
|
|
156
128
|
gtUint8 b,
|
|
@@ -330,7 +302,7 @@ abstract contract DataPrivacyFrameworkMpc is DataPrivacyFramework {
|
|
|
330
302
|
)
|
|
331
303
|
internal
|
|
332
304
|
onlyAllowedUserOperation("op_mul", uintParameter, addressParameter, stringParameter)
|
|
333
|
-
returns (
|
|
305
|
+
returns (gtUint16)
|
|
334
306
|
{
|
|
335
307
|
return MpcCore.mul(a, b);
|
|
336
308
|
}
|
|
@@ -405,34 +377,6 @@ abstract contract DataPrivacyFrameworkMpc is DataPrivacyFramework {
|
|
|
405
377
|
return MpcCore.xor(a, b);
|
|
406
378
|
}
|
|
407
379
|
|
|
408
|
-
function shl(
|
|
409
|
-
gtUint16 a,
|
|
410
|
-
gtUint16 b,
|
|
411
|
-
uint256 uintParameter,
|
|
412
|
-
address addressParameter,
|
|
413
|
-
string calldata stringParameter
|
|
414
|
-
)
|
|
415
|
-
internal
|
|
416
|
-
onlyAllowedUserOperation("op_shl", uintParameter, addressParameter, stringParameter)
|
|
417
|
-
returns (gtUint16)
|
|
418
|
-
{
|
|
419
|
-
return MpcCore.shl(a, b);
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
function shr(
|
|
423
|
-
gtUint16 a,
|
|
424
|
-
gtUint16 b,
|
|
425
|
-
uint256 uintParameter,
|
|
426
|
-
address addressParameter,
|
|
427
|
-
string calldata stringParameter
|
|
428
|
-
)
|
|
429
|
-
internal
|
|
430
|
-
onlyAllowedUserOperation("op_shr", uintParameter, addressParameter, stringParameter)
|
|
431
|
-
returns (gtUint16)
|
|
432
|
-
{
|
|
433
|
-
return MpcCore.shr(a, b);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
380
|
function eq(
|
|
437
381
|
gtUint16 a,
|
|
438
382
|
gtUint16 b,
|
|
@@ -612,7 +556,7 @@ abstract contract DataPrivacyFrameworkMpc is DataPrivacyFramework {
|
|
|
612
556
|
)
|
|
613
557
|
internal
|
|
614
558
|
onlyAllowedUserOperation("op_mul", uintParameter, addressParameter, stringParameter)
|
|
615
|
-
returns (
|
|
559
|
+
returns (gtUint32)
|
|
616
560
|
{
|
|
617
561
|
return MpcCore.mul(a, b);
|
|
618
562
|
}
|
|
@@ -687,34 +631,6 @@ abstract contract DataPrivacyFrameworkMpc is DataPrivacyFramework {
|
|
|
687
631
|
return MpcCore.xor(a, b);
|
|
688
632
|
}
|
|
689
633
|
|
|
690
|
-
function shl(
|
|
691
|
-
gtUint32 a,
|
|
692
|
-
gtUint32 b,
|
|
693
|
-
uint256 uintParameter,
|
|
694
|
-
address addressParameter,
|
|
695
|
-
string calldata stringParameter
|
|
696
|
-
)
|
|
697
|
-
internal
|
|
698
|
-
onlyAllowedUserOperation("op_shl", uintParameter, addressParameter, stringParameter)
|
|
699
|
-
returns (gtUint32)
|
|
700
|
-
{
|
|
701
|
-
return MpcCore.shl(a, b);
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
function shr(
|
|
705
|
-
gtUint32 a,
|
|
706
|
-
gtUint32 b,
|
|
707
|
-
uint256 uintParameter,
|
|
708
|
-
address addressParameter,
|
|
709
|
-
string calldata stringParameter
|
|
710
|
-
)
|
|
711
|
-
internal
|
|
712
|
-
onlyAllowedUserOperation("op_shr", uintParameter, addressParameter, stringParameter)
|
|
713
|
-
returns (gtUint32)
|
|
714
|
-
{
|
|
715
|
-
return MpcCore.shr(a, b);
|
|
716
|
-
}
|
|
717
|
-
|
|
718
634
|
function eq(
|
|
719
635
|
gtUint32 a,
|
|
720
636
|
gtUint32 b,
|
|
@@ -969,34 +885,6 @@ abstract contract DataPrivacyFrameworkMpc is DataPrivacyFramework {
|
|
|
969
885
|
return MpcCore.xor(a, b);
|
|
970
886
|
}
|
|
971
887
|
|
|
972
|
-
function shl(
|
|
973
|
-
gtUint64 a,
|
|
974
|
-
gtUint64 b,
|
|
975
|
-
uint256 uintParameter,
|
|
976
|
-
address addressParameter,
|
|
977
|
-
string calldata stringParameter
|
|
978
|
-
)
|
|
979
|
-
internal
|
|
980
|
-
onlyAllowedUserOperation("op_shl", uintParameter, addressParameter, stringParameter)
|
|
981
|
-
returns (gtUint64)
|
|
982
|
-
{
|
|
983
|
-
return MpcCore.shl(a, b);
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
function shr(
|
|
987
|
-
gtUint64 a,
|
|
988
|
-
gtUint64 b,
|
|
989
|
-
uint256 uintParameter,
|
|
990
|
-
address addressParameter,
|
|
991
|
-
string calldata stringParameter
|
|
992
|
-
)
|
|
993
|
-
internal
|
|
994
|
-
onlyAllowedUserOperation("op_shr", uintParameter, addressParameter, stringParameter)
|
|
995
|
-
returns (gtUint64)
|
|
996
|
-
{
|
|
997
|
-
return MpcCore.shr(a, b);
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
888
|
function eq(
|
|
1001
889
|
gtUint64 a,
|
|
1002
890
|
gtUint64 b,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
## Disclaimer
|
|
2
2
|
|
|
3
|
-
The Solidity contracts in **the mocks folder** are provided **for testing purposes only
|
|
3
|
+
The Solidity contracts in **the mocks folder** are provided **for testing purposes only**, however they may provide useful examples of calling functions from the MPC Core. They are not intended for use in production environments and should not be deployed without thorough review and auditing.
|
|
4
4
|
|
|
5
5
|
For additional examples, please refer to the [coti-contracts-examples repository](https://github.com/coti-io/coti-contracts-examples).
|