@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.
- package/.github/workflows/npm-publish.yml +2 -1
- package/CONTRIBUTING.md +2 -2
- package/LICENSE +1 -1
- package/README.md +18 -35
- 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/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/hardhat.config.ts +9 -1
- package/package.json +20 -4
- package/test/token/PrivateERC20/PrivateERC20.test.ts +2 -2
- package/test/utils/mpc/Precompile.test.ts +16 -2
- 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 +6 -0
- package/typechain-types/contracts/token/PrivateERC721/IERC721Errors.ts +69 -0
- package/typechain-types/contracts/token/PrivateERC721/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__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/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 +6 -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/hardhat.d.ts +126 -0
- package/typechain-types/index.ts +12 -0
- package/contracts/access/DataPrivacyFramework/README.md +0 -68
- 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,57 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.19;
|
|
4
|
+
|
|
5
|
+
interface IERC721Errors {
|
|
6
|
+
/**
|
|
7
|
+
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
|
|
8
|
+
* Used in balance queries.
|
|
9
|
+
* @param owner Address of the current owner of a token.
|
|
10
|
+
*/
|
|
11
|
+
error ERC721InvalidOwner(address owner);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @dev Indicates a `tokenId` whose `owner` is the zero address.
|
|
15
|
+
* @param tokenId Identifier number of a token.
|
|
16
|
+
*/
|
|
17
|
+
error ERC721NonexistentToken(uint256 tokenId);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
|
|
21
|
+
* @param sender Address whose tokens are being transferred.
|
|
22
|
+
* @param tokenId Identifier number of a token.
|
|
23
|
+
* @param owner Address of the current owner of a token.
|
|
24
|
+
*/
|
|
25
|
+
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @dev Indicates a failure with the token `sender`. Used in transfers.
|
|
29
|
+
* @param sender Address whose tokens are being transferred.
|
|
30
|
+
*/
|
|
31
|
+
error ERC721InvalidSender(address sender);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @dev Indicates a failure with the token `receiver`. Used in transfers.
|
|
35
|
+
* @param receiver Address to which tokens are being transferred.
|
|
36
|
+
*/
|
|
37
|
+
error ERC721InvalidReceiver(address receiver);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
|
|
41
|
+
* @param operator Address that may be allowed to operate on tokens without being their owner.
|
|
42
|
+
* @param tokenId Identifier number of a token.
|
|
43
|
+
*/
|
|
44
|
+
error ERC721InsufficientApproval(address operator, uint256 tokenId);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
|
|
48
|
+
* @param approver Address initiating an approval operation.
|
|
49
|
+
*/
|
|
50
|
+
error ERC721InvalidApprover(address approver);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
|
|
54
|
+
* @param operator Address that may be allowed to operate on tokens without being their owner.
|
|
55
|
+
*/
|
|
56
|
+
error ERC721InvalidOperator(address operator);
|
|
57
|
+
}
|
|
@@ -6,7 +6,7 @@ import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
|
|
|
6
6
|
import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
|
|
7
7
|
import {Context} from "@openzeppelin/contracts/utils/Context.sol";
|
|
8
8
|
import {IERC165, ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
9
|
-
import {IERC721Errors} from "
|
|
9
|
+
import {IERC721Errors} from "./IERC721Errors.sol";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard.
|
package/hardhat.config.ts
CHANGED
|
@@ -6,7 +6,15 @@ dotenv.config()
|
|
|
6
6
|
|
|
7
7
|
const config: HardhatUserConfig = {
|
|
8
8
|
defaultNetwork: "testnet",
|
|
9
|
-
solidity:
|
|
9
|
+
solidity: {
|
|
10
|
+
version: "0.8.19",
|
|
11
|
+
settings: {
|
|
12
|
+
optimizer: {
|
|
13
|
+
enabled: true,
|
|
14
|
+
runs: 10000
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
10
18
|
networks: {
|
|
11
19
|
testnet: {
|
|
12
20
|
url: "https://testnet.coti.io/rpc",
|
package/package.json
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coti-io/coti-contracts",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "A library for smart contract development on the COTI network.",
|
|
5
|
+
"author": "COTI Development",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git://github.com/coti-io/coti-contracts.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://docs.coti.io/coti-v2-documentation/build-on-coti/tools/contracts-library",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"coti",
|
|
13
|
+
"privacy",
|
|
14
|
+
"ethereum",
|
|
15
|
+
"blockchain",
|
|
16
|
+
"web3",
|
|
17
|
+
"garbled-circuits",
|
|
18
|
+
"l2",
|
|
19
|
+
"on-chain-compute"
|
|
20
|
+
],
|
|
5
21
|
"devDependencies": {
|
|
6
22
|
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
|
|
7
23
|
"hardhat": "^2.22.8"
|
|
8
24
|
},
|
|
9
25
|
"dependencies": {
|
|
10
|
-
"@coti-io/coti-ethers": "^1.0.
|
|
11
|
-
"@openzeppelin/contracts": "^
|
|
26
|
+
"@coti-io/coti-ethers": "^1.0.3",
|
|
27
|
+
"@openzeppelin/contracts": "^4.9.6",
|
|
12
28
|
"dotenv": "^16.4.5"
|
|
13
29
|
}
|
|
14
30
|
}
|
|
@@ -50,8 +50,8 @@ describe("Private ERC20", function () {
|
|
|
50
50
|
await expect(await contract.symbol()).to.equal("PE20M");
|
|
51
51
|
})
|
|
52
52
|
|
|
53
|
-
it('has
|
|
54
|
-
await expect(await contract.decimals()).to.equal(
|
|
53
|
+
it('has 6 decimals', async function () {
|
|
54
|
+
await expect(await contract.decimals()).to.equal(6n);
|
|
55
55
|
})
|
|
56
56
|
})
|
|
57
57
|
|
|
@@ -42,8 +42,12 @@ function buildTestWithUser(contractName: string, func: string, resFunc: string,
|
|
|
42
42
|
|
|
43
43
|
await (await contract.getFunction(func)(param, owner.address, { gasLimit: 12000000 })).wait()
|
|
44
44
|
const results = await contract.getFunction(resFunc)()
|
|
45
|
-
for (
|
|
46
|
-
|
|
45
|
+
for (let i = 0; i < results.length; i++) {
|
|
46
|
+
if (i === 0) {
|
|
47
|
+
expect(Boolean(await owner.decryptValue(results[i]))).to.equal(true)
|
|
48
|
+
} else {
|
|
49
|
+
expect(await owner.decryptValue(results[i])).to.equal(param)
|
|
50
|
+
}
|
|
47
51
|
}
|
|
48
52
|
})
|
|
49
53
|
}
|
|
@@ -57,8 +61,11 @@ const bool_b = false
|
|
|
57
61
|
const [a, b] = params
|
|
58
62
|
describe("Precompile", function () {
|
|
59
63
|
buildTest("ArithmeticTestsContract", "addTest", "getAddResult", params, a + b)
|
|
64
|
+
buildTest("ArithmeticTestsContract", "checkedAddTest", "getAddResult", params, a + b)
|
|
60
65
|
buildTest("ArithmeticTestsContract", "subTest", "getSubResult", params, a - b)
|
|
66
|
+
buildTest("ArithmeticTestsContract", "checkedSubTest", "getSubResult", params, a - b)
|
|
61
67
|
buildTest("ArithmeticTestsContract", "mulTest", "getMulResult", params, a * b)
|
|
68
|
+
buildTest("ArithmeticTestsContract", "checkedMulTest", "getMulResult", params, a * b)
|
|
62
69
|
|
|
63
70
|
buildTest("MiscellaneousTestsContract", "divTest", "getDivResult", params, a / b)
|
|
64
71
|
buildTest("MiscellaneousTestsContract", "remTest", "getRemResult", params, a % b)
|
|
@@ -79,10 +86,17 @@ describe("Precompile", function () {
|
|
|
79
86
|
|
|
80
87
|
buildTest("TransferTestsContract", "transferTest", "getResults", [a, b, b], a - b, b + b, true)
|
|
81
88
|
buildTest("TransferScalarTestsContract", "transferScalarTest", "getResults", [a, b, b], a - b, b + b, true)
|
|
89
|
+
buildTest("TransferWithAllowanceTestsContract", "transferWithAllowanceTest", "getResults", [a, b, b, b], a - b, b + b, true, 0)
|
|
90
|
+
buildTest("TransferWithAllowance64_8TestsContract", "transferWithAllowance64Test", "getResults", [a, b, b, b], a - b, b + b, true, 0)
|
|
91
|
+
buildTest("TransferWithAllowance64_16TestsContract", "transferWithAllowance64Test", "getResults", [a, b, b, b], a - b, b + b, true, 0)
|
|
92
|
+
buildTest("TransferWithAllowance64_32TestsContract", "transferWithAllowance64Test", "getResults", [a, b, b, b], a - b, b + b, true, 0)
|
|
93
|
+
buildTest("TransferWithAllowance64_64TestsContract", "transferWithAllowance64Test", "getResults", [a, b, b, b], a - b, b + b, true, 0)
|
|
94
|
+
buildTest("TransferWithAllowanceScalarTestsContract", "transferWithAllowanceScalarTest", "getResults", [a, b, b, b], a - b, b + b, true, 0)
|
|
82
95
|
buildTest("OffboardToUserKeyTestContract", "offboardOnboardTest", "getOnboardOffboardResult", [a, a, a, a], a)
|
|
83
96
|
buildTest("MiscellaneousTestsContract", "notTest", "getBoolResult", [!!a], !a)
|
|
84
97
|
|
|
85
98
|
buildTestWithUser("OffboardToUserKeyTestContract", "offboardToUserTest", "getCTs", a)
|
|
99
|
+
buildTestWithUser("OffboardToUserKeyTestContract", "offboardCombinedTest", "getCTs", a)
|
|
86
100
|
buildTest("Miscellaneous1TestsContract", "randomTest", "getRandom", [], last_random_value)
|
|
87
101
|
buildTest("Miscellaneous1TestsContract", "randomBoundedTest", "getRandomBounded", [numBits], last_random_value)
|
|
88
102
|
buildTest(
|
|
@@ -119,6 +119,9 @@ export interface ArithmeticTestsContractInterface extends Interface {
|
|
|
119
119
|
getFunction(
|
|
120
120
|
nameOrSignature:
|
|
121
121
|
| "addTest"
|
|
122
|
+
| "checkedAddTest"
|
|
123
|
+
| "checkedMulTest"
|
|
124
|
+
| "checkedSubTest"
|
|
122
125
|
| "decryptAndCompareResults16"
|
|
123
126
|
| "decryptAndCompareResults32"
|
|
124
127
|
| "decryptAndCompareResults64"
|
|
@@ -134,6 +137,18 @@ export interface ArithmeticTestsContractInterface extends Interface {
|
|
|
134
137
|
functionFragment: "addTest",
|
|
135
138
|
values: [BigNumberish, BigNumberish]
|
|
136
139
|
): string;
|
|
140
|
+
encodeFunctionData(
|
|
141
|
+
functionFragment: "checkedAddTest",
|
|
142
|
+
values: [BigNumberish, BigNumberish]
|
|
143
|
+
): string;
|
|
144
|
+
encodeFunctionData(
|
|
145
|
+
functionFragment: "checkedMulTest",
|
|
146
|
+
values: [BigNumberish, BigNumberish]
|
|
147
|
+
): string;
|
|
148
|
+
encodeFunctionData(
|
|
149
|
+
functionFragment: "checkedSubTest",
|
|
150
|
+
values: [BigNumberish, BigNumberish]
|
|
151
|
+
): string;
|
|
137
152
|
encodeFunctionData(
|
|
138
153
|
functionFragment: "decryptAndCompareResults16",
|
|
139
154
|
values: [ArithmeticTestsContract.Check16Struct]
|
|
@@ -176,6 +191,18 @@ export interface ArithmeticTestsContractInterface extends Interface {
|
|
|
176
191
|
): string;
|
|
177
192
|
|
|
178
193
|
decodeFunctionResult(functionFragment: "addTest", data: BytesLike): Result;
|
|
194
|
+
decodeFunctionResult(
|
|
195
|
+
functionFragment: "checkedAddTest",
|
|
196
|
+
data: BytesLike
|
|
197
|
+
): Result;
|
|
198
|
+
decodeFunctionResult(
|
|
199
|
+
functionFragment: "checkedMulTest",
|
|
200
|
+
data: BytesLike
|
|
201
|
+
): Result;
|
|
202
|
+
decodeFunctionResult(
|
|
203
|
+
functionFragment: "checkedSubTest",
|
|
204
|
+
data: BytesLike
|
|
205
|
+
): Result;
|
|
179
206
|
decodeFunctionResult(
|
|
180
207
|
functionFragment: "decryptAndCompareResults16",
|
|
181
208
|
data: BytesLike
|
|
@@ -257,6 +284,24 @@ export interface ArithmeticTestsContract extends BaseContract {
|
|
|
257
284
|
"nonpayable"
|
|
258
285
|
>;
|
|
259
286
|
|
|
287
|
+
checkedAddTest: TypedContractMethod<
|
|
288
|
+
[a: BigNumberish, b: BigNumberish],
|
|
289
|
+
[bigint],
|
|
290
|
+
"nonpayable"
|
|
291
|
+
>;
|
|
292
|
+
|
|
293
|
+
checkedMulTest: TypedContractMethod<
|
|
294
|
+
[a: BigNumberish, b: BigNumberish],
|
|
295
|
+
[bigint],
|
|
296
|
+
"nonpayable"
|
|
297
|
+
>;
|
|
298
|
+
|
|
299
|
+
checkedSubTest: TypedContractMethod<
|
|
300
|
+
[a: BigNumberish, b: BigNumberish],
|
|
301
|
+
[bigint],
|
|
302
|
+
"nonpayable"
|
|
303
|
+
>;
|
|
304
|
+
|
|
260
305
|
decryptAndCompareResults16: TypedContractMethod<
|
|
261
306
|
[check16: ArithmeticTestsContract.Check16Struct],
|
|
262
307
|
[bigint],
|
|
@@ -314,6 +359,27 @@ export interface ArithmeticTestsContract extends BaseContract {
|
|
|
314
359
|
[bigint],
|
|
315
360
|
"nonpayable"
|
|
316
361
|
>;
|
|
362
|
+
getFunction(
|
|
363
|
+
nameOrSignature: "checkedAddTest"
|
|
364
|
+
): TypedContractMethod<
|
|
365
|
+
[a: BigNumberish, b: BigNumberish],
|
|
366
|
+
[bigint],
|
|
367
|
+
"nonpayable"
|
|
368
|
+
>;
|
|
369
|
+
getFunction(
|
|
370
|
+
nameOrSignature: "checkedMulTest"
|
|
371
|
+
): TypedContractMethod<
|
|
372
|
+
[a: BigNumberish, b: BigNumberish],
|
|
373
|
+
[bigint],
|
|
374
|
+
"nonpayable"
|
|
375
|
+
>;
|
|
376
|
+
getFunction(
|
|
377
|
+
nameOrSignature: "checkedSubTest"
|
|
378
|
+
): TypedContractMethod<
|
|
379
|
+
[a: BigNumberish, b: BigNumberish],
|
|
380
|
+
[bigint],
|
|
381
|
+
"nonpayable"
|
|
382
|
+
>;
|
|
317
383
|
getFunction(
|
|
318
384
|
nameOrSignature: "decryptAndCompareResults16"
|
|
319
385
|
): TypedContractMethod<
|
|
@@ -84,6 +84,8 @@ export declare namespace BitwiseTestsContract {
|
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
export type AllGTCastingValuesStruct = {
|
|
87
|
+
aBool_s: BigNumberish;
|
|
88
|
+
bBool_s: BigNumberish;
|
|
87
89
|
a8_s: BigNumberish;
|
|
88
90
|
b8_s: BigNumberish;
|
|
89
91
|
a16_s: BigNumberish;
|
|
@@ -95,6 +97,8 @@ export declare namespace BitwiseTestsContract {
|
|
|
95
97
|
};
|
|
96
98
|
|
|
97
99
|
export type AllGTCastingValuesStructOutput = [
|
|
100
|
+
aBool_s: bigint,
|
|
101
|
+
bBool_s: bigint,
|
|
98
102
|
a8_s: bigint,
|
|
99
103
|
b8_s: bigint,
|
|
100
104
|
a16_s: bigint,
|
|
@@ -104,6 +108,8 @@ export declare namespace BitwiseTestsContract {
|
|
|
104
108
|
a64_s: bigint,
|
|
105
109
|
b64_s: bigint
|
|
106
110
|
] & {
|
|
111
|
+
aBool_s: bigint;
|
|
112
|
+
bBool_s: bigint;
|
|
107
113
|
a8_s: bigint;
|
|
108
114
|
b8_s: bigint;
|
|
109
115
|
a16_s: bigint;
|
|
@@ -84,6 +84,8 @@ export declare namespace Comparison2TestsContract {
|
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
export type AllGTCastingValuesStruct = {
|
|
87
|
+
aBool_s: BigNumberish;
|
|
88
|
+
bBool_s: BigNumberish;
|
|
87
89
|
a8_s: BigNumberish;
|
|
88
90
|
b8_s: BigNumberish;
|
|
89
91
|
a16_s: BigNumberish;
|
|
@@ -95,6 +97,8 @@ export declare namespace Comparison2TestsContract {
|
|
|
95
97
|
};
|
|
96
98
|
|
|
97
99
|
export type AllGTCastingValuesStructOutput = [
|
|
100
|
+
aBool_s: bigint,
|
|
101
|
+
bBool_s: bigint,
|
|
98
102
|
a8_s: bigint,
|
|
99
103
|
b8_s: bigint,
|
|
100
104
|
a16_s: bigint,
|
|
@@ -104,6 +108,8 @@ export declare namespace Comparison2TestsContract {
|
|
|
104
108
|
a64_s: bigint,
|
|
105
109
|
b64_s: bigint
|
|
106
110
|
] & {
|
|
111
|
+
aBool_s: bigint;
|
|
112
|
+
bBool_s: bigint;
|
|
107
113
|
a8_s: bigint;
|
|
108
114
|
b8_s: bigint;
|
|
109
115
|
a16_s: bigint;
|
|
@@ -30,6 +30,7 @@ export interface OffboardToUserKeyTestContractInterface extends Interface {
|
|
|
30
30
|
| "getUserKeyShares"
|
|
31
31
|
| "getUserKeyTest"
|
|
32
32
|
| "getX"
|
|
33
|
+
| "offboardCombinedTest"
|
|
33
34
|
| "offboardOnboardTest"
|
|
34
35
|
| "offboardToUserTest"
|
|
35
36
|
| "userKeyTest"
|
|
@@ -50,6 +51,10 @@ export interface OffboardToUserKeyTestContractInterface extends Interface {
|
|
|
50
51
|
values: [BytesLike, BytesLike, AddressLike]
|
|
51
52
|
): string;
|
|
52
53
|
encodeFunctionData(functionFragment: "getX", values?: undefined): string;
|
|
54
|
+
encodeFunctionData(
|
|
55
|
+
functionFragment: "offboardCombinedTest",
|
|
56
|
+
values: [BigNumberish, AddressLike]
|
|
57
|
+
): string;
|
|
53
58
|
encodeFunctionData(
|
|
54
59
|
functionFragment: "offboardOnboardTest",
|
|
55
60
|
values: [BigNumberish, BigNumberish, BigNumberish, BigNumberish]
|
|
@@ -78,6 +83,10 @@ export interface OffboardToUserKeyTestContractInterface extends Interface {
|
|
|
78
83
|
data: BytesLike
|
|
79
84
|
): Result;
|
|
80
85
|
decodeFunctionResult(functionFragment: "getX", data: BytesLike): Result;
|
|
86
|
+
decodeFunctionResult(
|
|
87
|
+
functionFragment: "offboardCombinedTest",
|
|
88
|
+
data: BytesLike
|
|
89
|
+
): Result;
|
|
81
90
|
decodeFunctionResult(
|
|
82
91
|
functionFragment: "offboardOnboardTest",
|
|
83
92
|
data: BytesLike
|
|
@@ -135,7 +144,11 @@ export interface OffboardToUserKeyTestContract extends BaseContract {
|
|
|
135
144
|
event?: TCEvent
|
|
136
145
|
): Promise<this>;
|
|
137
146
|
|
|
138
|
-
getCTs: TypedContractMethod<
|
|
147
|
+
getCTs: TypedContractMethod<
|
|
148
|
+
[],
|
|
149
|
+
[[bigint, bigint, bigint, bigint, bigint]],
|
|
150
|
+
"view"
|
|
151
|
+
>;
|
|
139
152
|
|
|
140
153
|
getCt: TypedContractMethod<[], [bigint], "view">;
|
|
141
154
|
|
|
@@ -151,15 +164,21 @@ export interface OffboardToUserKeyTestContract extends BaseContract {
|
|
|
151
164
|
|
|
152
165
|
getX: TypedContractMethod<[], [bigint], "view">;
|
|
153
166
|
|
|
167
|
+
offboardCombinedTest: TypedContractMethod<
|
|
168
|
+
[a: BigNumberish, addr: AddressLike],
|
|
169
|
+
[void],
|
|
170
|
+
"nonpayable"
|
|
171
|
+
>;
|
|
172
|
+
|
|
154
173
|
offboardOnboardTest: TypedContractMethod<
|
|
155
174
|
[a8: BigNumberish, a16: BigNumberish, a32: BigNumberish, a64: BigNumberish],
|
|
156
|
-
[
|
|
175
|
+
[void],
|
|
157
176
|
"nonpayable"
|
|
158
177
|
>;
|
|
159
178
|
|
|
160
179
|
offboardToUserTest: TypedContractMethod<
|
|
161
180
|
[a: BigNumberish, addr: AddressLike],
|
|
162
|
-
[
|
|
181
|
+
[void],
|
|
163
182
|
"nonpayable"
|
|
164
183
|
>;
|
|
165
184
|
|
|
@@ -175,7 +194,11 @@ export interface OffboardToUserKeyTestContract extends BaseContract {
|
|
|
175
194
|
|
|
176
195
|
getFunction(
|
|
177
196
|
nameOrSignature: "getCTs"
|
|
178
|
-
): TypedContractMethod<
|
|
197
|
+
): TypedContractMethod<
|
|
198
|
+
[],
|
|
199
|
+
[[bigint, bigint, bigint, bigint, bigint]],
|
|
200
|
+
"view"
|
|
201
|
+
>;
|
|
179
202
|
getFunction(
|
|
180
203
|
nameOrSignature: "getCt"
|
|
181
204
|
): TypedContractMethod<[], [bigint], "view">;
|
|
@@ -195,18 +218,25 @@ export interface OffboardToUserKeyTestContract extends BaseContract {
|
|
|
195
218
|
getFunction(
|
|
196
219
|
nameOrSignature: "getX"
|
|
197
220
|
): TypedContractMethod<[], [bigint], "view">;
|
|
221
|
+
getFunction(
|
|
222
|
+
nameOrSignature: "offboardCombinedTest"
|
|
223
|
+
): TypedContractMethod<
|
|
224
|
+
[a: BigNumberish, addr: AddressLike],
|
|
225
|
+
[void],
|
|
226
|
+
"nonpayable"
|
|
227
|
+
>;
|
|
198
228
|
getFunction(
|
|
199
229
|
nameOrSignature: "offboardOnboardTest"
|
|
200
230
|
): TypedContractMethod<
|
|
201
231
|
[a8: BigNumberish, a16: BigNumberish, a32: BigNumberish, a64: BigNumberish],
|
|
202
|
-
[
|
|
232
|
+
[void],
|
|
203
233
|
"nonpayable"
|
|
204
234
|
>;
|
|
205
235
|
getFunction(
|
|
206
236
|
nameOrSignature: "offboardToUserTest"
|
|
207
237
|
): TypedContractMethod<
|
|
208
238
|
[a: BigNumberish, addr: AddressLike],
|
|
209
|
-
[
|
|
239
|
+
[void],
|
|
210
240
|
"nonpayable"
|
|
211
241
|
>;
|
|
212
242
|
getFunction(
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import type {
|
|
5
|
+
BaseContract,
|
|
6
|
+
BigNumberish,
|
|
7
|
+
BytesLike,
|
|
8
|
+
FunctionFragment,
|
|
9
|
+
Result,
|
|
10
|
+
Interface,
|
|
11
|
+
ContractRunner,
|
|
12
|
+
ContractMethod,
|
|
13
|
+
Listener,
|
|
14
|
+
} from "ethers";
|
|
15
|
+
import type {
|
|
16
|
+
TypedContractEvent,
|
|
17
|
+
TypedDeferredTopicFilter,
|
|
18
|
+
TypedEventLog,
|
|
19
|
+
TypedListener,
|
|
20
|
+
TypedContractMethod,
|
|
21
|
+
} from "../../../../../common";
|
|
22
|
+
|
|
23
|
+
export declare namespace TransferWithAllowance64TestsContract {
|
|
24
|
+
export type AllGTCastingValuesStruct = {
|
|
25
|
+
a8_s: BigNumberish;
|
|
26
|
+
b8_s: BigNumberish;
|
|
27
|
+
a16_s: BigNumberish;
|
|
28
|
+
b16_s: BigNumberish;
|
|
29
|
+
a32_s: BigNumberish;
|
|
30
|
+
b32_s: BigNumberish;
|
|
31
|
+
a64_s: BigNumberish;
|
|
32
|
+
b64_s: BigNumberish;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type AllGTCastingValuesStructOutput = [
|
|
36
|
+
a8_s: bigint,
|
|
37
|
+
b8_s: bigint,
|
|
38
|
+
a16_s: bigint,
|
|
39
|
+
b16_s: bigint,
|
|
40
|
+
a32_s: bigint,
|
|
41
|
+
b32_s: bigint,
|
|
42
|
+
a64_s: bigint,
|
|
43
|
+
b64_s: bigint
|
|
44
|
+
] & {
|
|
45
|
+
a8_s: bigint;
|
|
46
|
+
b8_s: bigint;
|
|
47
|
+
a16_s: bigint;
|
|
48
|
+
b16_s: bigint;
|
|
49
|
+
a32_s: bigint;
|
|
50
|
+
b32_s: bigint;
|
|
51
|
+
a64_s: bigint;
|
|
52
|
+
b64_s: bigint;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type AllAmountValuesStruct = {
|
|
56
|
+
amount8_s: BigNumberish;
|
|
57
|
+
amount16_s: BigNumberish;
|
|
58
|
+
amount32_s: BigNumberish;
|
|
59
|
+
amount64_s: BigNumberish;
|
|
60
|
+
amount: BigNumberish;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type AllAmountValuesStructOutput = [
|
|
64
|
+
amount8_s: bigint,
|
|
65
|
+
amount16_s: bigint,
|
|
66
|
+
amount32_s: bigint,
|
|
67
|
+
amount64_s: bigint,
|
|
68
|
+
amount: bigint
|
|
69
|
+
] & {
|
|
70
|
+
amount8_s: bigint;
|
|
71
|
+
amount16_s: bigint;
|
|
72
|
+
amount32_s: bigint;
|
|
73
|
+
amount64_s: bigint;
|
|
74
|
+
amount: bigint;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export type AllAllowanceValuesStruct = {
|
|
78
|
+
allowance8_s: BigNumberish;
|
|
79
|
+
allowance16_s: BigNumberish;
|
|
80
|
+
allowance32_s: BigNumberish;
|
|
81
|
+
allowance64_s: BigNumberish;
|
|
82
|
+
allowance: BigNumberish;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type AllAllowanceValuesStructOutput = [
|
|
86
|
+
allowance8_s: bigint,
|
|
87
|
+
allowance16_s: bigint,
|
|
88
|
+
allowance32_s: bigint,
|
|
89
|
+
allowance64_s: bigint,
|
|
90
|
+
allowance: bigint
|
|
91
|
+
] & {
|
|
92
|
+
allowance8_s: bigint;
|
|
93
|
+
allowance16_s: bigint;
|
|
94
|
+
allowance32_s: bigint;
|
|
95
|
+
allowance64_s: bigint;
|
|
96
|
+
allowance: bigint;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface TransferWithAllowance64TestsContractInterface
|
|
101
|
+
extends Interface {
|
|
102
|
+
getFunction(
|
|
103
|
+
nameOrSignature:
|
|
104
|
+
| "computeAndCheckTransfer64"
|
|
105
|
+
| "getResults"
|
|
106
|
+
| "transferWithAllowanceTest"
|
|
107
|
+
): FunctionFragment;
|
|
108
|
+
|
|
109
|
+
encodeFunctionData(
|
|
110
|
+
functionFragment: "computeAndCheckTransfer64",
|
|
111
|
+
values: [
|
|
112
|
+
TransferWithAllowance64TestsContract.AllGTCastingValuesStruct,
|
|
113
|
+
TransferWithAllowance64TestsContract.AllAmountValuesStruct,
|
|
114
|
+
TransferWithAllowance64TestsContract.AllAllowanceValuesStruct,
|
|
115
|
+
BigNumberish,
|
|
116
|
+
BigNumberish,
|
|
117
|
+
boolean,
|
|
118
|
+
BigNumberish
|
|
119
|
+
]
|
|
120
|
+
): string;
|
|
121
|
+
encodeFunctionData(
|
|
122
|
+
functionFragment: "getResults",
|
|
123
|
+
values?: undefined
|
|
124
|
+
): string;
|
|
125
|
+
encodeFunctionData(
|
|
126
|
+
functionFragment: "transferWithAllowanceTest",
|
|
127
|
+
values: [BigNumberish, BigNumberish, BigNumberish, BigNumberish]
|
|
128
|
+
): string;
|
|
129
|
+
|
|
130
|
+
decodeFunctionResult(
|
|
131
|
+
functionFragment: "computeAndCheckTransfer64",
|
|
132
|
+
data: BytesLike
|
|
133
|
+
): Result;
|
|
134
|
+
decodeFunctionResult(functionFragment: "getResults", data: BytesLike): Result;
|
|
135
|
+
decodeFunctionResult(
|
|
136
|
+
functionFragment: "transferWithAllowanceTest",
|
|
137
|
+
data: BytesLike
|
|
138
|
+
): Result;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface TransferWithAllowance64TestsContract extends BaseContract {
|
|
142
|
+
connect(runner?: ContractRunner | null): TransferWithAllowance64TestsContract;
|
|
143
|
+
waitForDeployment(): Promise<this>;
|
|
144
|
+
|
|
145
|
+
interface: TransferWithAllowance64TestsContractInterface;
|
|
146
|
+
|
|
147
|
+
queryFilter<TCEvent extends TypedContractEvent>(
|
|
148
|
+
event: TCEvent,
|
|
149
|
+
fromBlockOrBlockhash?: string | number | undefined,
|
|
150
|
+
toBlock?: string | number | undefined
|
|
151
|
+
): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
152
|
+
queryFilter<TCEvent extends TypedContractEvent>(
|
|
153
|
+
filter: TypedDeferredTopicFilter<TCEvent>,
|
|
154
|
+
fromBlockOrBlockhash?: string | number | undefined,
|
|
155
|
+
toBlock?: string | number | undefined
|
|
156
|
+
): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
157
|
+
|
|
158
|
+
on<TCEvent extends TypedContractEvent>(
|
|
159
|
+
event: TCEvent,
|
|
160
|
+
listener: TypedListener<TCEvent>
|
|
161
|
+
): Promise<this>;
|
|
162
|
+
on<TCEvent extends TypedContractEvent>(
|
|
163
|
+
filter: TypedDeferredTopicFilter<TCEvent>,
|
|
164
|
+
listener: TypedListener<TCEvent>
|
|
165
|
+
): Promise<this>;
|
|
166
|
+
|
|
167
|
+
once<TCEvent extends TypedContractEvent>(
|
|
168
|
+
event: TCEvent,
|
|
169
|
+
listener: TypedListener<TCEvent>
|
|
170
|
+
): Promise<this>;
|
|
171
|
+
once<TCEvent extends TypedContractEvent>(
|
|
172
|
+
filter: TypedDeferredTopicFilter<TCEvent>,
|
|
173
|
+
listener: TypedListener<TCEvent>
|
|
174
|
+
): Promise<this>;
|
|
175
|
+
|
|
176
|
+
listeners<TCEvent extends TypedContractEvent>(
|
|
177
|
+
event: TCEvent
|
|
178
|
+
): Promise<Array<TypedListener<TCEvent>>>;
|
|
179
|
+
listeners(eventName?: string): Promise<Array<Listener>>;
|
|
180
|
+
removeAllListeners<TCEvent extends TypedContractEvent>(
|
|
181
|
+
event?: TCEvent
|
|
182
|
+
): Promise<this>;
|
|
183
|
+
|
|
184
|
+
computeAndCheckTransfer64: TypedContractMethod<
|
|
185
|
+
[
|
|
186
|
+
allGTCastingValues: TransferWithAllowance64TestsContract.AllGTCastingValuesStruct,
|
|
187
|
+
allAmountValues: TransferWithAllowance64TestsContract.AllAmountValuesStruct,
|
|
188
|
+
allAllowanceValues: TransferWithAllowance64TestsContract.AllAllowanceValuesStruct,
|
|
189
|
+
new_a: BigNumberish,
|
|
190
|
+
new_b: BigNumberish,
|
|
191
|
+
res: boolean,
|
|
192
|
+
new_allowance: BigNumberish
|
|
193
|
+
],
|
|
194
|
+
[void],
|
|
195
|
+
"nonpayable"
|
|
196
|
+
>;
|
|
197
|
+
|
|
198
|
+
getResults: TypedContractMethod<
|
|
199
|
+
[],
|
|
200
|
+
[[bigint, bigint, boolean, bigint]],
|
|
201
|
+
"view"
|
|
202
|
+
>;
|
|
203
|
+
|
|
204
|
+
transferWithAllowanceTest: TypedContractMethod<
|
|
205
|
+
[
|
|
206
|
+
a: BigNumberish,
|
|
207
|
+
b: BigNumberish,
|
|
208
|
+
amount: BigNumberish,
|
|
209
|
+
allowance: BigNumberish
|
|
210
|
+
],
|
|
211
|
+
[[bigint, bigint, boolean, bigint]],
|
|
212
|
+
"nonpayable"
|
|
213
|
+
>;
|
|
214
|
+
|
|
215
|
+
getFunction<T extends ContractMethod = ContractMethod>(
|
|
216
|
+
key: string | FunctionFragment
|
|
217
|
+
): T;
|
|
218
|
+
|
|
219
|
+
getFunction(
|
|
220
|
+
nameOrSignature: "computeAndCheckTransfer64"
|
|
221
|
+
): TypedContractMethod<
|
|
222
|
+
[
|
|
223
|
+
allGTCastingValues: TransferWithAllowance64TestsContract.AllGTCastingValuesStruct,
|
|
224
|
+
allAmountValues: TransferWithAllowance64TestsContract.AllAmountValuesStruct,
|
|
225
|
+
allAllowanceValues: TransferWithAllowance64TestsContract.AllAllowanceValuesStruct,
|
|
226
|
+
new_a: BigNumberish,
|
|
227
|
+
new_b: BigNumberish,
|
|
228
|
+
res: boolean,
|
|
229
|
+
new_allowance: BigNumberish
|
|
230
|
+
],
|
|
231
|
+
[void],
|
|
232
|
+
"nonpayable"
|
|
233
|
+
>;
|
|
234
|
+
getFunction(
|
|
235
|
+
nameOrSignature: "getResults"
|
|
236
|
+
): TypedContractMethod<[], [[bigint, bigint, boolean, bigint]], "view">;
|
|
237
|
+
getFunction(
|
|
238
|
+
nameOrSignature: "transferWithAllowanceTest"
|
|
239
|
+
): TypedContractMethod<
|
|
240
|
+
[
|
|
241
|
+
a: BigNumberish,
|
|
242
|
+
b: BigNumberish,
|
|
243
|
+
amount: BigNumberish,
|
|
244
|
+
allowance: BigNumberish
|
|
245
|
+
],
|
|
246
|
+
[[bigint, bigint, boolean, bigint]],
|
|
247
|
+
"nonpayable"
|
|
248
|
+
>;
|
|
249
|
+
|
|
250
|
+
filters: {};
|
|
251
|
+
}
|