@coti-io/coti-contracts 0.1.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.
- 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 +3 -115
- package/contracts/mocks/README.md +1 -1
- package/contracts/mocks/utils/mpc/ArithmeticTestsContract.sol +257 -280
- package/contracts/mocks/utils/mpc/BitwiseTestsContract.sol +93 -187
- package/contracts/mocks/utils/mpc/{Comparison1Tests.Contract.sol → Comparison1TestsContract.sol} +67 -115
- package/contracts/mocks/utils/mpc/Comparison2TestsContract.sol +76 -116
- package/contracts/mocks/utils/mpc/MinMaxTestsContract.sol +69 -164
- package/contracts/mocks/utils/mpc/Miscellaneous1TestsContract.sol +103 -56
- package/contracts/mocks/utils/mpc/MiscellaneousTestsContract.sol +270 -0
- package/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract.sol +127 -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 +165 -640
- 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/onboard/AccountOnboard.sol +3 -3
- 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 +2835 -988
- package/contracts/utils/mpc/MpcInterface.sol +6 -4
- package/hardhat.config.ts +17 -6
- package/package.json +20 -4
- package/test/token/PrivateERC20/PrivateERC20.test.ts +2 -2
- package/test/utils/accounts.ts +1 -1
- package/test/utils/mpc/Precompile.test.ts +42 -39
- 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 +96 -10
- package/typechain-types/contracts/mocks/utils/mpc/BitwiseTestsContract.ts +45 -5
- package/typechain-types/contracts/mocks/utils/mpc/Comparison1TestsContract.ts +374 -0
- package/typechain-types/contracts/mocks/utils/mpc/Comparison2TestsContract.ts +45 -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 +251 -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/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 +9 -6
- package/typechain-types/contracts/onboard/AccountOnboard.ts +9 -4
- 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/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 +92 -7
- package/typechain-types/factories/contracts/mocks/utils/mpc/BitwiseTestsContract__factory.ts +38 -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 +38 -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 +285 -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/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 +9 -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/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 +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 +152 -26
- package/typechain-types/index.ts +20 -8
- package/contracts/access/DataPrivacyFramework/README.md +0 -68
- 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
- package/contracts/token/PrivateERC20/README.md +0 -104
- package/contracts/token/PrivateERC721/README.md +0 -282
- package/contracts/utils/mpc/README.md +0 -82
|
@@ -43,8 +43,9 @@ jobs:
|
|
|
43
43
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
44
44
|
- uses: actions/setup-node@v3
|
|
45
45
|
with:
|
|
46
|
-
node-version:
|
|
46
|
+
node-version: 18
|
|
47
47
|
registry-url: https://registry.npmjs.org/
|
|
48
|
+
scope: '@coti-io'
|
|
48
49
|
- run: npm ci
|
|
49
50
|
- run: npm publish --access=public
|
|
50
51
|
env:
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
# Contributing to COTI
|
|
2
|
+
# Contributing to COTI Contracts
|
|
3
3
|
|
|
4
|
-
Thank you for your interest in contributing to the COTI
|
|
4
|
+
Thank you for your interest in contributing to the COTI Contracts project! We welcome contributions from the community and appreciate your efforts to improve our project.
|
|
5
5
|
|
|
6
6
|
## Table of Contents
|
|
7
7
|
|
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2024 COTI
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -1,48 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
> [!NOTE]
|
|
6
|
-
> This repository is meant to replace the now-deprecated [confidentiality-contracts](https://github.com/coti-io/confidentiality-contracts) repository.
|
|
7
|
-
|
|
8
|
-
#### Important Links
|
|
9
|
-
|
|
10
|
-
[Docs](https://docs.coti.io) | [Discord](https://discord.gg/cuCykh8P4m) | [Faucet](https://faucet.coti.io)
|
|
11
|
-
|
|
12
|
-
#### Network-Specific Links
|
|
1
|
+
[](https://telegram.coti.io)
|
|
2
|
+
[](https://discord.coti.io)
|
|
3
|
+
[](https://twitter.coti.io)
|
|
4
|
+
[](https://youtube.coti.io)
|
|
13
5
|
|
|
14
|
-
|
|
6
|
+
# COTI Contracts
|
|
15
7
|
|
|
16
|
-
|
|
8
|
+
[](https://www.npmjs.com/package/@coti-io/coti-contracts)
|
|
9
|
+
[](https://nodejs.org/download/release/v18.20.5/)
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
> Due to the nature of ongoing development, future versions might break existing functionality
|
|
11
|
+
Welcome to COTI Contracts, a library of smart contracts for COTI's GC technology, including MPC contract for secure computations, private ERC20 and ERC721 contracts, and test mocks for validation. These components enable privacy-focused and decentralized DeFi solutions.
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
- [DataPrivacyFramework](/contracts/access/DataPrivacyFramework/)
|
|
23
|
-
- [AccountOnboard](/contracts/onboard/)
|
|
24
|
-
- [PrivateERC20](/contracts/token/PrivateERC20/)
|
|
25
|
-
- [PrivateERC721](/contracts/token/PrivateERC721/)
|
|
26
|
-
- [MpcCore](/contracts/utils/mpc/)
|
|
13
|
+
## Documentation
|
|
27
14
|
|
|
28
|
-
|
|
15
|
+
Full API documentation is available in the [COTI docs](https://docs.coti.io/coti-v2-documentation/build-on-coti/tools/ethers.js)
|
|
29
16
|
|
|
30
|
-
|
|
17
|
+
## Build and Install
|
|
31
18
|
|
|
32
19
|
```bash
|
|
33
|
-
npm install
|
|
20
|
+
npm install
|
|
34
21
|
```
|
|
35
22
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Once installed, you can use the contracts in the library by importing them:
|
|
23
|
+
## Testing
|
|
39
24
|
|
|
40
|
-
```
|
|
41
|
-
|
|
25
|
+
```bash
|
|
26
|
+
npx hardhat test
|
|
27
|
+
```
|
|
42
28
|
|
|
43
|
-
|
|
29
|
+
---
|
|
44
30
|
|
|
45
|
-
|
|
46
|
-
constructor() ERC721("MyToken", "MTOK") {}
|
|
47
|
-
}
|
|
48
|
-
```
|
|
31
|
+
To report an issue, please see the [issues](https://github.com/coti-io/coti-contracts/issues/new) tab.
|
|
@@ -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).
|