@coti-io/coti-contracts 1.0.4 → 1.0.6
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 +6 -6
- package/contracts/mocks/utils/mpc/CheckedArithmeticWIthOverflowBitTestsContract.sol +309 -0
- package/contracts/utils/mpc/MpcCore.sol +527 -18
- package/contracts/utils/mpc/MpcInterface.sol +1 -2
- package/package.json +1 -1
- package/test/utils/mpc/CheckedArithmetic.test.ts +41 -0
- package/typechain-types/contracts/mocks/utils/mpc/{ArithmeticTestsContract.sol → ArithmeticWithOverflowBitTestsContract.sol}/ArithmeticTestsContract.ts +52 -43
- package/typechain-types/contracts/mocks/utils/mpc/{ArithmeticTestsContract.sol → ArithmeticWithOverflowBitTestsContract.sol}/index.ts +0 -1
- package/typechain-types/contracts/mocks/utils/mpc/{ArithmeticTestsContract.sol/PrecompilesArythmeticTestsContract.ts → CheckedArithmeticWIthOverflowBitTestsContract.sol/CheckedArithmeticWithOverflowBitTestsContract.ts} +73 -60
- package/typechain-types/contracts/mocks/utils/mpc/CheckedArithmeticWIthOverflowBitTestsContract.sol/index.ts +4 -0
- package/typechain-types/contracts/mocks/utils/mpc/index.ts +4 -0
- package/typechain-types/contracts/utils/mpc/MpcInterface.sol/ExtendedOperations.ts +43 -18
- 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 +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/ArithmeticWithOverflowBitTestsContract.sol/ArithmeticTestsContract__factory.ts +387 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/{ArithmeticTestsContract.sol → ArithmeticWithOverflowBitTestsContract.sol}/index.ts +0 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/BitwiseTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/CheckedArithmeticWIthOverflowBitTestsContract.sol/CheckedArithmeticWithOverflowBitTestsContract__factory.ts +397 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/CheckedArithmeticWIthOverflowBitTestsContract.sol/index.ts +4 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison1TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison2TestsContract__factory.ts +1 -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 +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/ShiftTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/StringTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferScalarTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/index.ts +2 -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/utils/mpc/MpcCore__factory.ts +1 -1
- package/typechain-types/factories/contracts/utils/mpc/MpcInterface.sol/ExtendedOperations__factory.ts +44 -19
- package/typechain-types/hardhat.d.ts +36 -0
- package/typechain-types/index.ts +2 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors.ts +0 -69
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors.ts +0 -69
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors.ts +0 -69
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.ts +0 -6
- package/typechain-types/contracts/GasTest.ts +0 -91
- package/typechain-types/contracts/mocks/utils/mpc/Comparison1Tests.Contract.sol/Comparison1TestsContract.ts +0 -340
- package/typechain-types/contracts/mocks/utils/mpc/Comparison1Tests.Contract.sol/index.ts +0 -4
- package/typechain-types/contracts/mocks/utils/mpc/Miscellaneous2TestsContract.ts +0 -384
- package/typechain-types/contracts/mocks/utils/mpc/OffboardToUserKeyTestsContract.sol/OffboardToUserKeyTestContract.ts +0 -221
- package/typechain-types/contracts/mocks/utils/mpc/OffboardToUserKeyTestsContract.sol/index.ts +0 -4
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/TransferWithAllowance64TestsContract.ts +0 -251
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/TransferWithAllowanceTestsContract.ts +0 -250
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/index.ts +0 -5
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.ts +0 -389
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/TransferWithAllowance64_64TestsContract.ts +0 -391
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/TransferWithAllowance64_8TestsContract.ts +0 -391
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/index.ts +0 -5
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/TransferTestsContract.ts +0 -125
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/TransferWithAllowanceTestsContract.ts +0 -125
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/index.ts +0 -5
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors__factory.ts +0 -127
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors__factory.ts +0 -111
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors__factory.ts +0 -128
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.ts +0 -6
- package/typechain-types/factories/contracts/GasTest__factory.ts +0 -75
- package/typechain-types/factories/contracts/mocks/utils/mpc/ArithmeticTestsContract.sol/ArithmeticTestsContract__factory.ts +0 -387
- package/typechain-types/factories/contracts/mocks/utils/mpc/ArithmeticTestsContract.sol/PrecompilesArythmeticTestsContract__factory.ts +0 -388
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison1Tests.Contract.sol/Comparison1TestsContract__factory.ts +0 -361
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison1Tests.Contract.sol/index.ts +0 -4
- package/typechain-types/factories/contracts/mocks/utils/mpc/Miscellaneous2TestsContract__factory.ts +0 -432
- package/typechain-types/factories/contracts/mocks/utils/mpc/OffboardToUserKeyTestsContract.sol/OffboardToUserKeyTestContract__factory.ts +0 -261
- package/typechain-types/factories/contracts/mocks/utils/mpc/OffboardToUserKeyTestsContract.sol/index.ts +0 -4
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/TransferWithAllowance64TestsContract__factory.ts +0 -294
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/TransferWithAllowanceTestsContract__factory.ts +0 -292
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract.sol/index.ts +0 -5
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64TestsContract__factory.ts +0 -720
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/TransferWithAllowance64_64TestsContract__factory.ts +0 -724
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/TransferWithAllowance64_8TestsContract__factory.ts +0 -724
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol/index.ts +0 -5
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/TransferTestsContract__factory.ts +0 -150
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/TransferWithAllowanceTestsContract__factory.ts +0 -150
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol/index.ts +0 -5
|
@@ -10,7 +10,6 @@ interface ExtendedOperations {
|
|
|
10
10
|
function SetPublic(bytes1 metaData, uint256 ct) external returns (uint256 result);
|
|
11
11
|
function Rand(bytes1 metaData) external returns (uint256 result);
|
|
12
12
|
function RandBoundedBits(bytes1 metaData, uint8 numBits) external returns (uint256 result);
|
|
13
|
-
|
|
14
13
|
function Add(bytes3 metaData, uint256 lhs, uint256 rhs) external returns (uint256 result);
|
|
15
14
|
function CheckedAdd(bytes3 metaData, uint256 lhs, uint256 rhs) external returns (uint256 overflowBit, uint256 result);
|
|
16
15
|
function Sub(bytes3 metaData, uint256 lhs, uint256 rhs) external returns (uint256 result);
|
|
@@ -39,7 +38,7 @@ interface ExtendedOperations {
|
|
|
39
38
|
function TransferWithAllowance(bytes5 metaData, uint256 a, uint256 b, uint256 amount, uint256 allowance) external returns (uint256 new_a, uint256 new_b, uint256 res, uint256 new_allowance);
|
|
40
39
|
function ValidateCiphertext(bytes1 metaData, uint256 ciphertext, bytes calldata signature) external returns (uint256 result);
|
|
41
40
|
function GetUserKey(bytes calldata signedEK) external returns (bytes memory encryptedKey);
|
|
42
|
-
function
|
|
41
|
+
function SHA256Fixed432BitInput(uint256 amount, uint256 seed1, uint256 seed2, uint256 padding1, uint256 padding2, bytes calldata addr) external returns (bytes memory result);
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
address constant MPC_PRECOMPILE = address(0x0000000000000000000000000000000000000064);
|
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import hre from "hardhat"
|
|
2
|
+
import { expect } from "chai"
|
|
3
|
+
import { setupAccounts } from "../accounts"
|
|
4
|
+
|
|
5
|
+
const gasLimit = 12000000
|
|
6
|
+
let last_random_value = 0
|
|
7
|
+
|
|
8
|
+
function buildTest(
|
|
9
|
+
contractName: string,
|
|
10
|
+
func: string,
|
|
11
|
+
resFunc: string,
|
|
12
|
+
params: (bigint | number | boolean)[],
|
|
13
|
+
...expectedResults: (number | boolean | bigint)[]
|
|
14
|
+
) {
|
|
15
|
+
it(`${contractName}.${func}(${params}) should return ${expectedResults}`, async function () {
|
|
16
|
+
const [owner] = await setupAccounts()
|
|
17
|
+
|
|
18
|
+
const factory = await hre.ethers.getContractFactory(contractName, owner as any)
|
|
19
|
+
const contract = await factory.deploy({ gasLimit })
|
|
20
|
+
await contract.waitForDeployment()
|
|
21
|
+
|
|
22
|
+
await (await contract.getFunction(func)(...params, { gasLimit })).wait()
|
|
23
|
+
const result = await contract.getFunction(resFunc)()
|
|
24
|
+
if (resFunc === "getRandom" || resFunc === "getRandomBounded") {
|
|
25
|
+
expect(result).to.not.equal(expectedResults[0])
|
|
26
|
+
last_random_value = result
|
|
27
|
+
} else if (expectedResults.length === 1) {
|
|
28
|
+
expect(result).to.equal(expectedResults[0])
|
|
29
|
+
} else {
|
|
30
|
+
expect(result).to.deep.equal(expectedResults)
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const params = [10, 5]
|
|
36
|
+
const [a, b] = params
|
|
37
|
+
describe("Precompile", function () {
|
|
38
|
+
buildTest("CheckedArithmeticWithOverflowBitTestsContract", "checkedAddWithOverflowBitTest", "getAddResult", params, a + b)
|
|
39
|
+
buildTest("CheckedArithmeticWithOverflowBitTestsContract", "checkedSubWithOverflowBitTest", "getSubResult", params, a - b)
|
|
40
|
+
buildTest("CheckedArithmeticWithOverflowBitTestsContract", "checkedMulWithOverflowBitTest", "getMulResult", params, a * b)
|
|
41
|
+
})
|
|
@@ -118,20 +118,28 @@ export declare namespace ArithmeticTestsContract {
|
|
|
118
118
|
export interface ArithmeticTestsContractInterface extends Interface {
|
|
119
119
|
getFunction(
|
|
120
120
|
nameOrSignature:
|
|
121
|
-
| "
|
|
121
|
+
| "checkedAddWithOverflowBitTest"
|
|
122
|
+
| "checkedMulWithOverflowBitTest"
|
|
123
|
+
| "checkedSubWithOverflowBitTest"
|
|
122
124
|
| "decryptAndCompareResults16"
|
|
123
125
|
| "decryptAndCompareResults32"
|
|
124
126
|
| "decryptAndCompareResults64"
|
|
125
127
|
| "getAddResult"
|
|
126
128
|
| "getMulResult"
|
|
127
129
|
| "getSubResult"
|
|
128
|
-
| "mulTest"
|
|
129
130
|
| "setPublicValues"
|
|
130
|
-
| "subTest"
|
|
131
131
|
): FunctionFragment;
|
|
132
132
|
|
|
133
133
|
encodeFunctionData(
|
|
134
|
-
functionFragment: "
|
|
134
|
+
functionFragment: "checkedAddWithOverflowBitTest",
|
|
135
|
+
values: [BigNumberish, BigNumberish]
|
|
136
|
+
): string;
|
|
137
|
+
encodeFunctionData(
|
|
138
|
+
functionFragment: "checkedMulWithOverflowBitTest",
|
|
139
|
+
values: [BigNumberish, BigNumberish]
|
|
140
|
+
): string;
|
|
141
|
+
encodeFunctionData(
|
|
142
|
+
functionFragment: "checkedSubWithOverflowBitTest",
|
|
135
143
|
values: [BigNumberish, BigNumberish]
|
|
136
144
|
): string;
|
|
137
145
|
encodeFunctionData(
|
|
@@ -158,10 +166,6 @@ export interface ArithmeticTestsContractInterface extends Interface {
|
|
|
158
166
|
functionFragment: "getSubResult",
|
|
159
167
|
values?: undefined
|
|
160
168
|
): string;
|
|
161
|
-
encodeFunctionData(
|
|
162
|
-
functionFragment: "mulTest",
|
|
163
|
-
values: [BigNumberish, BigNumberish]
|
|
164
|
-
): string;
|
|
165
169
|
encodeFunctionData(
|
|
166
170
|
functionFragment: "setPublicValues",
|
|
167
171
|
values: [
|
|
@@ -170,12 +174,19 @@ export interface ArithmeticTestsContractInterface extends Interface {
|
|
|
170
174
|
BigNumberish
|
|
171
175
|
]
|
|
172
176
|
): string;
|
|
173
|
-
encodeFunctionData(
|
|
174
|
-
functionFragment: "subTest",
|
|
175
|
-
values: [BigNumberish, BigNumberish]
|
|
176
|
-
): string;
|
|
177
177
|
|
|
178
|
-
decodeFunctionResult(
|
|
178
|
+
decodeFunctionResult(
|
|
179
|
+
functionFragment: "checkedAddWithOverflowBitTest",
|
|
180
|
+
data: BytesLike
|
|
181
|
+
): Result;
|
|
182
|
+
decodeFunctionResult(
|
|
183
|
+
functionFragment: "checkedMulWithOverflowBitTest",
|
|
184
|
+
data: BytesLike
|
|
185
|
+
): Result;
|
|
186
|
+
decodeFunctionResult(
|
|
187
|
+
functionFragment: "checkedSubWithOverflowBitTest",
|
|
188
|
+
data: BytesLike
|
|
189
|
+
): Result;
|
|
179
190
|
decodeFunctionResult(
|
|
180
191
|
functionFragment: "decryptAndCompareResults16",
|
|
181
192
|
data: BytesLike
|
|
@@ -200,12 +211,10 @@ export interface ArithmeticTestsContractInterface extends Interface {
|
|
|
200
211
|
functionFragment: "getSubResult",
|
|
201
212
|
data: BytesLike
|
|
202
213
|
): Result;
|
|
203
|
-
decodeFunctionResult(functionFragment: "mulTest", data: BytesLike): Result;
|
|
204
214
|
decodeFunctionResult(
|
|
205
215
|
functionFragment: "setPublicValues",
|
|
206
216
|
data: BytesLike
|
|
207
217
|
): Result;
|
|
208
|
-
decodeFunctionResult(functionFragment: "subTest", data: BytesLike): Result;
|
|
209
218
|
}
|
|
210
219
|
|
|
211
220
|
export interface ArithmeticTestsContract extends BaseContract {
|
|
@@ -251,7 +260,19 @@ export interface ArithmeticTestsContract extends BaseContract {
|
|
|
251
260
|
event?: TCEvent
|
|
252
261
|
): Promise<this>;
|
|
253
262
|
|
|
254
|
-
|
|
263
|
+
checkedAddWithOverflowBitTest: TypedContractMethod<
|
|
264
|
+
[a: BigNumberish, b: BigNumberish],
|
|
265
|
+
[bigint],
|
|
266
|
+
"nonpayable"
|
|
267
|
+
>;
|
|
268
|
+
|
|
269
|
+
checkedMulWithOverflowBitTest: TypedContractMethod<
|
|
270
|
+
[a: BigNumberish, b: BigNumberish],
|
|
271
|
+
[bigint],
|
|
272
|
+
"nonpayable"
|
|
273
|
+
>;
|
|
274
|
+
|
|
275
|
+
checkedSubWithOverflowBitTest: TypedContractMethod<
|
|
255
276
|
[a: BigNumberish, b: BigNumberish],
|
|
256
277
|
[bigint],
|
|
257
278
|
"nonpayable"
|
|
@@ -281,12 +302,6 @@ export interface ArithmeticTestsContract extends BaseContract {
|
|
|
281
302
|
|
|
282
303
|
getSubResult: TypedContractMethod<[], [bigint], "view">;
|
|
283
304
|
|
|
284
|
-
mulTest: TypedContractMethod<
|
|
285
|
-
[a: BigNumberish, b: BigNumberish],
|
|
286
|
-
[bigint],
|
|
287
|
-
"nonpayable"
|
|
288
|
-
>;
|
|
289
|
-
|
|
290
305
|
setPublicValues: TypedContractMethod<
|
|
291
306
|
[
|
|
292
307
|
castingValues: ArithmeticTestsContract.AllGTCastingValuesStruct,
|
|
@@ -297,18 +312,26 @@ export interface ArithmeticTestsContract extends BaseContract {
|
|
|
297
312
|
"nonpayable"
|
|
298
313
|
>;
|
|
299
314
|
|
|
300
|
-
subTest: TypedContractMethod<
|
|
301
|
-
[a: BigNumberish, b: BigNumberish],
|
|
302
|
-
[bigint],
|
|
303
|
-
"nonpayable"
|
|
304
|
-
>;
|
|
305
|
-
|
|
306
315
|
getFunction<T extends ContractMethod = ContractMethod>(
|
|
307
316
|
key: string | FunctionFragment
|
|
308
317
|
): T;
|
|
309
318
|
|
|
310
319
|
getFunction(
|
|
311
|
-
nameOrSignature: "
|
|
320
|
+
nameOrSignature: "checkedAddWithOverflowBitTest"
|
|
321
|
+
): TypedContractMethod<
|
|
322
|
+
[a: BigNumberish, b: BigNumberish],
|
|
323
|
+
[bigint],
|
|
324
|
+
"nonpayable"
|
|
325
|
+
>;
|
|
326
|
+
getFunction(
|
|
327
|
+
nameOrSignature: "checkedMulWithOverflowBitTest"
|
|
328
|
+
): TypedContractMethod<
|
|
329
|
+
[a: BigNumberish, b: BigNumberish],
|
|
330
|
+
[bigint],
|
|
331
|
+
"nonpayable"
|
|
332
|
+
>;
|
|
333
|
+
getFunction(
|
|
334
|
+
nameOrSignature: "checkedSubWithOverflowBitTest"
|
|
312
335
|
): TypedContractMethod<
|
|
313
336
|
[a: BigNumberish, b: BigNumberish],
|
|
314
337
|
[bigint],
|
|
@@ -344,13 +367,6 @@ export interface ArithmeticTestsContract extends BaseContract {
|
|
|
344
367
|
getFunction(
|
|
345
368
|
nameOrSignature: "getSubResult"
|
|
346
369
|
): TypedContractMethod<[], [bigint], "view">;
|
|
347
|
-
getFunction(
|
|
348
|
-
nameOrSignature: "mulTest"
|
|
349
|
-
): TypedContractMethod<
|
|
350
|
-
[a: BigNumberish, b: BigNumberish],
|
|
351
|
-
[bigint],
|
|
352
|
-
"nonpayable"
|
|
353
|
-
>;
|
|
354
370
|
getFunction(
|
|
355
371
|
nameOrSignature: "setPublicValues"
|
|
356
372
|
): TypedContractMethod<
|
|
@@ -362,13 +378,6 @@ export interface ArithmeticTestsContract extends BaseContract {
|
|
|
362
378
|
[void],
|
|
363
379
|
"nonpayable"
|
|
364
380
|
>;
|
|
365
|
-
getFunction(
|
|
366
|
-
nameOrSignature: "subTest"
|
|
367
|
-
): TypedContractMethod<
|
|
368
|
-
[a: BigNumberish, b: BigNumberish],
|
|
369
|
-
[bigint],
|
|
370
|
-
"nonpayable"
|
|
371
|
-
>;
|
|
372
381
|
|
|
373
382
|
filters: {};
|
|
374
383
|
}
|
|
@@ -20,7 +20,7 @@ import type {
|
|
|
20
20
|
TypedContractMethod,
|
|
21
21
|
} from "../../../../../common";
|
|
22
22
|
|
|
23
|
-
export declare namespace
|
|
23
|
+
export declare namespace CheckedArithmeticWithOverflowBitTestsContract {
|
|
24
24
|
export type Check16Struct = {
|
|
25
25
|
res16_16: BigNumberish;
|
|
26
26
|
res8_16: BigNumberish;
|
|
@@ -115,36 +115,45 @@ export declare namespace PrecompilesArythmeticTestsContract {
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
export interface
|
|
118
|
+
export interface CheckedArithmeticWithOverflowBitTestsContractInterface
|
|
119
|
+
extends Interface {
|
|
119
120
|
getFunction(
|
|
120
121
|
nameOrSignature:
|
|
121
|
-
| "
|
|
122
|
+
| "checkedAddWithOverflowBitTest"
|
|
123
|
+
| "checkedMulWithOverflowBitTest"
|
|
124
|
+
| "checkedSubWithOverflowBitTest"
|
|
122
125
|
| "decryptAndCompareResults16"
|
|
123
126
|
| "decryptAndCompareResults32"
|
|
124
127
|
| "decryptAndCompareResults64"
|
|
125
128
|
| "getAddResult"
|
|
126
129
|
| "getMulResult"
|
|
127
130
|
| "getSubResult"
|
|
128
|
-
| "mulTest"
|
|
129
131
|
| "setPublicValues"
|
|
130
|
-
| "subTest"
|
|
131
132
|
): FunctionFragment;
|
|
132
133
|
|
|
133
134
|
encodeFunctionData(
|
|
134
|
-
functionFragment: "
|
|
135
|
+
functionFragment: "checkedAddWithOverflowBitTest",
|
|
136
|
+
values: [BigNumberish, BigNumberish]
|
|
137
|
+
): string;
|
|
138
|
+
encodeFunctionData(
|
|
139
|
+
functionFragment: "checkedMulWithOverflowBitTest",
|
|
140
|
+
values: [BigNumberish, BigNumberish]
|
|
141
|
+
): string;
|
|
142
|
+
encodeFunctionData(
|
|
143
|
+
functionFragment: "checkedSubWithOverflowBitTest",
|
|
135
144
|
values: [BigNumberish, BigNumberish]
|
|
136
145
|
): string;
|
|
137
146
|
encodeFunctionData(
|
|
138
147
|
functionFragment: "decryptAndCompareResults16",
|
|
139
|
-
values: [
|
|
148
|
+
values: [CheckedArithmeticWithOverflowBitTestsContract.Check16Struct]
|
|
140
149
|
): string;
|
|
141
150
|
encodeFunctionData(
|
|
142
151
|
functionFragment: "decryptAndCompareResults32",
|
|
143
|
-
values: [
|
|
152
|
+
values: [CheckedArithmeticWithOverflowBitTestsContract.Check32Struct]
|
|
144
153
|
): string;
|
|
145
154
|
encodeFunctionData(
|
|
146
155
|
functionFragment: "decryptAndCompareResults64",
|
|
147
|
-
values: [
|
|
156
|
+
values: [CheckedArithmeticWithOverflowBitTestsContract.Check64Struct]
|
|
148
157
|
): string;
|
|
149
158
|
encodeFunctionData(
|
|
150
159
|
functionFragment: "getAddResult",
|
|
@@ -158,24 +167,27 @@ export interface PrecompilesArythmeticTestsContractInterface extends Interface {
|
|
|
158
167
|
functionFragment: "getSubResult",
|
|
159
168
|
values?: undefined
|
|
160
169
|
): string;
|
|
161
|
-
encodeFunctionData(
|
|
162
|
-
functionFragment: "mulTest",
|
|
163
|
-
values: [BigNumberish, BigNumberish]
|
|
164
|
-
): string;
|
|
165
170
|
encodeFunctionData(
|
|
166
171
|
functionFragment: "setPublicValues",
|
|
167
172
|
values: [
|
|
168
|
-
|
|
173
|
+
CheckedArithmeticWithOverflowBitTestsContract.AllGTCastingValuesStruct,
|
|
169
174
|
BigNumberish,
|
|
170
175
|
BigNumberish
|
|
171
176
|
]
|
|
172
177
|
): string;
|
|
173
|
-
encodeFunctionData(
|
|
174
|
-
functionFragment: "subTest",
|
|
175
|
-
values: [BigNumberish, BigNumberish]
|
|
176
|
-
): string;
|
|
177
178
|
|
|
178
|
-
decodeFunctionResult(
|
|
179
|
+
decodeFunctionResult(
|
|
180
|
+
functionFragment: "checkedAddWithOverflowBitTest",
|
|
181
|
+
data: BytesLike
|
|
182
|
+
): Result;
|
|
183
|
+
decodeFunctionResult(
|
|
184
|
+
functionFragment: "checkedMulWithOverflowBitTest",
|
|
185
|
+
data: BytesLike
|
|
186
|
+
): Result;
|
|
187
|
+
decodeFunctionResult(
|
|
188
|
+
functionFragment: "checkedSubWithOverflowBitTest",
|
|
189
|
+
data: BytesLike
|
|
190
|
+
): Result;
|
|
179
191
|
decodeFunctionResult(
|
|
180
192
|
functionFragment: "decryptAndCompareResults16",
|
|
181
193
|
data: BytesLike
|
|
@@ -200,19 +212,20 @@ export interface PrecompilesArythmeticTestsContractInterface extends Interface {
|
|
|
200
212
|
functionFragment: "getSubResult",
|
|
201
213
|
data: BytesLike
|
|
202
214
|
): Result;
|
|
203
|
-
decodeFunctionResult(functionFragment: "mulTest", data: BytesLike): Result;
|
|
204
215
|
decodeFunctionResult(
|
|
205
216
|
functionFragment: "setPublicValues",
|
|
206
217
|
data: BytesLike
|
|
207
218
|
): Result;
|
|
208
|
-
decodeFunctionResult(functionFragment: "subTest", data: BytesLike): Result;
|
|
209
219
|
}
|
|
210
220
|
|
|
211
|
-
export interface
|
|
212
|
-
|
|
221
|
+
export interface CheckedArithmeticWithOverflowBitTestsContract
|
|
222
|
+
extends BaseContract {
|
|
223
|
+
connect(
|
|
224
|
+
runner?: ContractRunner | null
|
|
225
|
+
): CheckedArithmeticWithOverflowBitTestsContract;
|
|
213
226
|
waitForDeployment(): Promise<this>;
|
|
214
227
|
|
|
215
|
-
interface:
|
|
228
|
+
interface: CheckedArithmeticWithOverflowBitTestsContractInterface;
|
|
216
229
|
|
|
217
230
|
queryFilter<TCEvent extends TypedContractEvent>(
|
|
218
231
|
event: TCEvent,
|
|
@@ -251,26 +264,38 @@ export interface PrecompilesArythmeticTestsContract extends BaseContract {
|
|
|
251
264
|
event?: TCEvent
|
|
252
265
|
): Promise<this>;
|
|
253
266
|
|
|
254
|
-
|
|
267
|
+
checkedAddWithOverflowBitTest: TypedContractMethod<
|
|
268
|
+
[a: BigNumberish, b: BigNumberish],
|
|
269
|
+
[bigint],
|
|
270
|
+
"nonpayable"
|
|
271
|
+
>;
|
|
272
|
+
|
|
273
|
+
checkedMulWithOverflowBitTest: TypedContractMethod<
|
|
274
|
+
[a: BigNumberish, b: BigNumberish],
|
|
275
|
+
[bigint],
|
|
276
|
+
"nonpayable"
|
|
277
|
+
>;
|
|
278
|
+
|
|
279
|
+
checkedSubWithOverflowBitTest: TypedContractMethod<
|
|
255
280
|
[a: BigNumberish, b: BigNumberish],
|
|
256
281
|
[bigint],
|
|
257
282
|
"nonpayable"
|
|
258
283
|
>;
|
|
259
284
|
|
|
260
285
|
decryptAndCompareResults16: TypedContractMethod<
|
|
261
|
-
[check16:
|
|
286
|
+
[check16: CheckedArithmeticWithOverflowBitTestsContract.Check16Struct],
|
|
262
287
|
[bigint],
|
|
263
288
|
"nonpayable"
|
|
264
289
|
>;
|
|
265
290
|
|
|
266
291
|
decryptAndCompareResults32: TypedContractMethod<
|
|
267
|
-
[check32:
|
|
292
|
+
[check32: CheckedArithmeticWithOverflowBitTestsContract.Check32Struct],
|
|
268
293
|
[bigint],
|
|
269
294
|
"nonpayable"
|
|
270
295
|
>;
|
|
271
296
|
|
|
272
297
|
decryptAndCompareResults64: TypedContractMethod<
|
|
273
|
-
[check64:
|
|
298
|
+
[check64: CheckedArithmeticWithOverflowBitTestsContract.Check64Struct],
|
|
274
299
|
[bigint],
|
|
275
300
|
"nonpayable"
|
|
276
301
|
>;
|
|
@@ -281,15 +306,9 @@ export interface PrecompilesArythmeticTestsContract extends BaseContract {
|
|
|
281
306
|
|
|
282
307
|
getSubResult: TypedContractMethod<[], [bigint], "view">;
|
|
283
308
|
|
|
284
|
-
mulTest: TypedContractMethod<
|
|
285
|
-
[a: BigNumberish, b: BigNumberish],
|
|
286
|
-
[bigint],
|
|
287
|
-
"nonpayable"
|
|
288
|
-
>;
|
|
289
|
-
|
|
290
309
|
setPublicValues: TypedContractMethod<
|
|
291
310
|
[
|
|
292
|
-
castingValues:
|
|
311
|
+
castingValues: CheckedArithmeticWithOverflowBitTestsContract.AllGTCastingValuesStruct,
|
|
293
312
|
a: BigNumberish,
|
|
294
313
|
b: BigNumberish
|
|
295
314
|
],
|
|
@@ -297,18 +316,26 @@ export interface PrecompilesArythmeticTestsContract extends BaseContract {
|
|
|
297
316
|
"nonpayable"
|
|
298
317
|
>;
|
|
299
318
|
|
|
300
|
-
subTest: TypedContractMethod<
|
|
301
|
-
[a: BigNumberish, b: BigNumberish],
|
|
302
|
-
[bigint],
|
|
303
|
-
"nonpayable"
|
|
304
|
-
>;
|
|
305
|
-
|
|
306
319
|
getFunction<T extends ContractMethod = ContractMethod>(
|
|
307
320
|
key: string | FunctionFragment
|
|
308
321
|
): T;
|
|
309
322
|
|
|
310
323
|
getFunction(
|
|
311
|
-
nameOrSignature: "
|
|
324
|
+
nameOrSignature: "checkedAddWithOverflowBitTest"
|
|
325
|
+
): TypedContractMethod<
|
|
326
|
+
[a: BigNumberish, b: BigNumberish],
|
|
327
|
+
[bigint],
|
|
328
|
+
"nonpayable"
|
|
329
|
+
>;
|
|
330
|
+
getFunction(
|
|
331
|
+
nameOrSignature: "checkedMulWithOverflowBitTest"
|
|
332
|
+
): TypedContractMethod<
|
|
333
|
+
[a: BigNumberish, b: BigNumberish],
|
|
334
|
+
[bigint],
|
|
335
|
+
"nonpayable"
|
|
336
|
+
>;
|
|
337
|
+
getFunction(
|
|
338
|
+
nameOrSignature: "checkedSubWithOverflowBitTest"
|
|
312
339
|
): TypedContractMethod<
|
|
313
340
|
[a: BigNumberish, b: BigNumberish],
|
|
314
341
|
[bigint],
|
|
@@ -317,21 +344,21 @@ export interface PrecompilesArythmeticTestsContract extends BaseContract {
|
|
|
317
344
|
getFunction(
|
|
318
345
|
nameOrSignature: "decryptAndCompareResults16"
|
|
319
346
|
): TypedContractMethod<
|
|
320
|
-
[check16:
|
|
347
|
+
[check16: CheckedArithmeticWithOverflowBitTestsContract.Check16Struct],
|
|
321
348
|
[bigint],
|
|
322
349
|
"nonpayable"
|
|
323
350
|
>;
|
|
324
351
|
getFunction(
|
|
325
352
|
nameOrSignature: "decryptAndCompareResults32"
|
|
326
353
|
): TypedContractMethod<
|
|
327
|
-
[check32:
|
|
354
|
+
[check32: CheckedArithmeticWithOverflowBitTestsContract.Check32Struct],
|
|
328
355
|
[bigint],
|
|
329
356
|
"nonpayable"
|
|
330
357
|
>;
|
|
331
358
|
getFunction(
|
|
332
359
|
nameOrSignature: "decryptAndCompareResults64"
|
|
333
360
|
): TypedContractMethod<
|
|
334
|
-
[check64:
|
|
361
|
+
[check64: CheckedArithmeticWithOverflowBitTestsContract.Check64Struct],
|
|
335
362
|
[bigint],
|
|
336
363
|
"nonpayable"
|
|
337
364
|
>;
|
|
@@ -344,31 +371,17 @@ export interface PrecompilesArythmeticTestsContract extends BaseContract {
|
|
|
344
371
|
getFunction(
|
|
345
372
|
nameOrSignature: "getSubResult"
|
|
346
373
|
): TypedContractMethod<[], [bigint], "view">;
|
|
347
|
-
getFunction(
|
|
348
|
-
nameOrSignature: "mulTest"
|
|
349
|
-
): TypedContractMethod<
|
|
350
|
-
[a: BigNumberish, b: BigNumberish],
|
|
351
|
-
[bigint],
|
|
352
|
-
"nonpayable"
|
|
353
|
-
>;
|
|
354
374
|
getFunction(
|
|
355
375
|
nameOrSignature: "setPublicValues"
|
|
356
376
|
): TypedContractMethod<
|
|
357
377
|
[
|
|
358
|
-
castingValues:
|
|
378
|
+
castingValues: CheckedArithmeticWithOverflowBitTestsContract.AllGTCastingValuesStruct,
|
|
359
379
|
a: BigNumberish,
|
|
360
380
|
b: BigNumberish
|
|
361
381
|
],
|
|
362
382
|
[void],
|
|
363
383
|
"nonpayable"
|
|
364
384
|
>;
|
|
365
|
-
getFunction(
|
|
366
|
-
nameOrSignature: "subTest"
|
|
367
|
-
): TypedContractMethod<
|
|
368
|
-
[a: BigNumberish, b: BigNumberish],
|
|
369
|
-
[bigint],
|
|
370
|
-
"nonpayable"
|
|
371
|
-
>;
|
|
372
385
|
|
|
373
386
|
filters: {};
|
|
374
387
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* Autogenerated file. Do not edit manually. */
|
|
2
2
|
/* tslint:disable */
|
|
3
3
|
/* eslint-disable */
|
|
4
|
+
import type * as arithmeticWithOverflowBitTestsContractSol from "./ArithmeticWithOverflowBitTestsContract.sol";
|
|
5
|
+
export type { arithmeticWithOverflowBitTestsContractSol };
|
|
6
|
+
import type * as checkedArithmeticWIthOverflowBitTestsContractSol from "./CheckedArithmeticWIthOverflowBitTestsContract.sol";
|
|
7
|
+
export type { checkedArithmeticWIthOverflowBitTestsContractSol };
|
|
4
8
|
export type { ArithmeticTestsContract } from "./ArithmeticTestsContract";
|
|
5
9
|
export type { BitwiseTestsContract } from "./BitwiseTestsContract";
|
|
6
10
|
export type { Comparison1TestsContract } from "./Comparison1TestsContract";
|
|
@@ -29,7 +29,6 @@ export interface ExtendedOperationsInterface extends Interface {
|
|
|
29
29
|
| "CheckedMul"
|
|
30
30
|
| "CheckedSub"
|
|
31
31
|
| "Decrypt"
|
|
32
|
-
| "DeleteUserKey"
|
|
33
32
|
| "Div"
|
|
34
33
|
| "Eq"
|
|
35
34
|
| "Ge"
|
|
@@ -50,6 +49,7 @@ export interface ExtendedOperationsInterface extends Interface {
|
|
|
50
49
|
| "Rand"
|
|
51
50
|
| "RandBoundedBits"
|
|
52
51
|
| "Rem"
|
|
52
|
+
| "SHA256Fixed432BitInput"
|
|
53
53
|
| "SetPublic"
|
|
54
54
|
| "Shl"
|
|
55
55
|
| "Shr"
|
|
@@ -84,10 +84,6 @@ export interface ExtendedOperationsInterface extends Interface {
|
|
|
84
84
|
functionFragment: "Decrypt",
|
|
85
85
|
values: [BytesLike, BigNumberish]
|
|
86
86
|
): string;
|
|
87
|
-
encodeFunctionData(
|
|
88
|
-
functionFragment: "DeleteUserKey",
|
|
89
|
-
values: [BytesLike]
|
|
90
|
-
): string;
|
|
91
87
|
encodeFunctionData(
|
|
92
88
|
functionFragment: "Div",
|
|
93
89
|
values: [BytesLike, BigNumberish, BigNumberish]
|
|
@@ -165,6 +161,17 @@ export interface ExtendedOperationsInterface extends Interface {
|
|
|
165
161
|
functionFragment: "Rem",
|
|
166
162
|
values: [BytesLike, BigNumberish, BigNumberish]
|
|
167
163
|
): string;
|
|
164
|
+
encodeFunctionData(
|
|
165
|
+
functionFragment: "SHA256Fixed432BitInput",
|
|
166
|
+
values: [
|
|
167
|
+
BigNumberish,
|
|
168
|
+
BigNumberish,
|
|
169
|
+
BigNumberish,
|
|
170
|
+
BigNumberish,
|
|
171
|
+
BigNumberish,
|
|
172
|
+
BytesLike
|
|
173
|
+
]
|
|
174
|
+
): string;
|
|
168
175
|
encodeFunctionData(
|
|
169
176
|
functionFragment: "SetPublic",
|
|
170
177
|
values: [BytesLike, BigNumberish]
|
|
@@ -204,10 +211,6 @@ export interface ExtendedOperationsInterface extends Interface {
|
|
|
204
211
|
decodeFunctionResult(functionFragment: "CheckedMul", data: BytesLike): Result;
|
|
205
212
|
decodeFunctionResult(functionFragment: "CheckedSub", data: BytesLike): Result;
|
|
206
213
|
decodeFunctionResult(functionFragment: "Decrypt", data: BytesLike): Result;
|
|
207
|
-
decodeFunctionResult(
|
|
208
|
-
functionFragment: "DeleteUserKey",
|
|
209
|
-
data: BytesLike
|
|
210
|
-
): Result;
|
|
211
214
|
decodeFunctionResult(functionFragment: "Div", data: BytesLike): Result;
|
|
212
215
|
decodeFunctionResult(functionFragment: "Eq", data: BytesLike): Result;
|
|
213
216
|
decodeFunctionResult(functionFragment: "Ge", data: BytesLike): Result;
|
|
@@ -234,6 +237,10 @@ export interface ExtendedOperationsInterface extends Interface {
|
|
|
234
237
|
data: BytesLike
|
|
235
238
|
): Result;
|
|
236
239
|
decodeFunctionResult(functionFragment: "Rem", data: BytesLike): Result;
|
|
240
|
+
decodeFunctionResult(
|
|
241
|
+
functionFragment: "SHA256Fixed432BitInput",
|
|
242
|
+
data: BytesLike
|
|
243
|
+
): Result;
|
|
237
244
|
decodeFunctionResult(functionFragment: "SetPublic", data: BytesLike): Result;
|
|
238
245
|
decodeFunctionResult(functionFragment: "Shl", data: BytesLike): Result;
|
|
239
246
|
decodeFunctionResult(functionFragment: "Shr", data: BytesLike): Result;
|
|
@@ -329,12 +336,6 @@ export interface ExtendedOperations extends BaseContract {
|
|
|
329
336
|
"nonpayable"
|
|
330
337
|
>;
|
|
331
338
|
|
|
332
|
-
DeleteUserKey: TypedContractMethod<
|
|
333
|
-
[signature: BytesLike],
|
|
334
|
-
[boolean],
|
|
335
|
-
"nonpayable"
|
|
336
|
-
>;
|
|
337
|
-
|
|
338
339
|
Div: TypedContractMethod<
|
|
339
340
|
[metaData: BytesLike, lhs: BigNumberish, rhs: BigNumberish],
|
|
340
341
|
[bigint],
|
|
@@ -451,6 +452,19 @@ export interface ExtendedOperations extends BaseContract {
|
|
|
451
452
|
"nonpayable"
|
|
452
453
|
>;
|
|
453
454
|
|
|
455
|
+
SHA256Fixed432BitInput: TypedContractMethod<
|
|
456
|
+
[
|
|
457
|
+
amount: BigNumberish,
|
|
458
|
+
seed1: BigNumberish,
|
|
459
|
+
seed2: BigNumberish,
|
|
460
|
+
padding1: BigNumberish,
|
|
461
|
+
padding2: BigNumberish,
|
|
462
|
+
addr: BytesLike
|
|
463
|
+
],
|
|
464
|
+
[string],
|
|
465
|
+
"nonpayable"
|
|
466
|
+
>;
|
|
467
|
+
|
|
454
468
|
SetPublic: TypedContractMethod<
|
|
455
469
|
[metaData: BytesLike, ct: BigNumberish],
|
|
456
470
|
[bigint],
|
|
@@ -563,9 +577,6 @@ export interface ExtendedOperations extends BaseContract {
|
|
|
563
577
|
[bigint],
|
|
564
578
|
"nonpayable"
|
|
565
579
|
>;
|
|
566
|
-
getFunction(
|
|
567
|
-
nameOrSignature: "DeleteUserKey"
|
|
568
|
-
): TypedContractMethod<[signature: BytesLike], [boolean], "nonpayable">;
|
|
569
580
|
getFunction(
|
|
570
581
|
nameOrSignature: "Div"
|
|
571
582
|
): TypedContractMethod<
|
|
@@ -698,6 +709,20 @@ export interface ExtendedOperations extends BaseContract {
|
|
|
698
709
|
[bigint],
|
|
699
710
|
"nonpayable"
|
|
700
711
|
>;
|
|
712
|
+
getFunction(
|
|
713
|
+
nameOrSignature: "SHA256Fixed432BitInput"
|
|
714
|
+
): TypedContractMethod<
|
|
715
|
+
[
|
|
716
|
+
amount: BigNumberish,
|
|
717
|
+
seed1: BigNumberish,
|
|
718
|
+
seed2: BigNumberish,
|
|
719
|
+
padding1: BigNumberish,
|
|
720
|
+
padding2: BigNumberish,
|
|
721
|
+
addr: BytesLike
|
|
722
|
+
],
|
|
723
|
+
[string],
|
|
724
|
+
"nonpayable"
|
|
725
|
+
>;
|
|
701
726
|
getFunction(
|
|
702
727
|
nameOrSignature: "SetPublic"
|
|
703
728
|
): TypedContractMethod<
|