@cofhe/mock-contracts 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +15 -13
- package/dist/index.d.mts +1 -332
- package/dist/index.d.ts +1 -332
- package/dist/index.js +0 -309
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -309
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -2
- package/src/typechain-types/index.ts +0 -1
- package/contracts/TestBed.sol +0 -103
- package/src/TestBed.ts +0 -309
- package/src/typechain-types/TestBed.ts +0 -172
package/contracts/TestBed.sol
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: UNLICENSED
|
|
2
|
-
pragma solidity ^0.8.13;
|
|
3
|
-
|
|
4
|
-
import { TASK_MANAGER_ADDRESS } from '@fhenixprotocol/cofhe-contracts/FHE.sol';
|
|
5
|
-
import { ITaskManager } from '@fhenixprotocol/cofhe-contracts/ICofhe.sol';
|
|
6
|
-
import '@fhenixprotocol/cofhe-contracts/FHE.sol';
|
|
7
|
-
|
|
8
|
-
/// @title TestBed
|
|
9
|
-
/// @notice Minimal contract used to smoke-test CoFHE/FHE flows (mocks + permissions + decrypt plumbing).
|
|
10
|
-
/// @dev This contract is intentionally simple and is primarily a convenience for Hardhat-based local
|
|
11
|
-
/// development: the Hardhat plugin can deploy it automatically when `deployTestBed` is enabled.
|
|
12
|
-
///
|
|
13
|
-
/// In Foundry flows, nothing deploys or depends on this contract automatically — tests must
|
|
14
|
-
/// instantiate it explicitly (this repository includes such Foundry tests). You may deploy/use it
|
|
15
|
-
/// in `forge test` if you want a known-good reference target.
|
|
16
|
-
///
|
|
17
|
-
/// Important concepts:
|
|
18
|
-
/// - `eNumber` is an on-chain encrypted handle type (`euint32`). In real CoFHE, this represents a ciphertext.
|
|
19
|
-
/// - `numberHash` stores the unwrapped handle (`ctHash`) as a uint256 for easy inspection/assertions.
|
|
20
|
-
/// - After every state update we call `FHE.allowThis(...)` and `FHE.allowSender(...)` so the contract
|
|
21
|
-
/// and the transaction sender can continue operating on / decrypting the updated handle.
|
|
22
|
-
contract TestBed {
|
|
23
|
-
euint32 public eNumber;
|
|
24
|
-
bytes32 public numberHash;
|
|
25
|
-
|
|
26
|
-
/// @notice Marker used by deploy scripts/tests to confirm the contract is deployed.
|
|
27
|
-
function exists() public pure returns (bool) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/// @notice Sets `eNumber` from an encrypted input struct.
|
|
32
|
-
/// @dev Typically used when testing client-side encryption flows.
|
|
33
|
-
function setNumber(InEuint32 memory inNumber) public {
|
|
34
|
-
eNumber = FHE.asEuint32(inNumber);
|
|
35
|
-
numberHash = euint32.unwrap(eNumber);
|
|
36
|
-
FHE.allowThis(eNumber);
|
|
37
|
-
FHE.allowSender(eNumber);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/// @notice Convenience setter that casts a plaintext value into an encrypted handle.
|
|
41
|
-
/// @dev Useful for quick smoke tests that don't need pre-encryption.
|
|
42
|
-
function setNumberTrivial(uint32 inNumber) public {
|
|
43
|
-
eNumber = FHE.asEuint32(inNumber);
|
|
44
|
-
numberHash = euint32.unwrap(eNumber);
|
|
45
|
-
FHE.allowThis(eNumber);
|
|
46
|
-
FHE.allowSender(eNumber);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/// @notice Increments `eNumber` by 1 using FHE arithmetic.
|
|
50
|
-
function increment() public {
|
|
51
|
-
eNumber = FHE.add(eNumber, FHE.asEuint32(1));
|
|
52
|
-
FHE.allowThis(eNumber);
|
|
53
|
-
FHE.allowSender(eNumber);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/// @notice Adds an encrypted input to `eNumber`.
|
|
57
|
-
function add(InEuint32 memory inNumber) public {
|
|
58
|
-
eNumber = FHE.add(eNumber, FHE.asEuint32(inNumber));
|
|
59
|
-
|
|
60
|
-
FHE.allowThis(eNumber);
|
|
61
|
-
FHE.allowSender(eNumber);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/// @notice Subtracts an encrypted input from `eNumber`, clamped to 0 to avoid underflow.
|
|
65
|
-
function sub(InEuint32 memory inNumber) public {
|
|
66
|
-
euint32 inAsEuint32 = FHE.asEuint32(inNumber);
|
|
67
|
-
euint32 eSubOrZero = FHE.select(FHE.lte(inAsEuint32, eNumber), inAsEuint32, FHE.asEuint32(0));
|
|
68
|
-
eNumber = FHE.sub(eNumber, eSubOrZero);
|
|
69
|
-
FHE.allowThis(eNumber);
|
|
70
|
-
FHE.allowSender(eNumber);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/// @notice Multiplies `eNumber` by an encrypted input.
|
|
74
|
-
function mul(InEuint32 memory inNumber) public {
|
|
75
|
-
eNumber = FHE.mul(eNumber, FHE.asEuint32(inNumber));
|
|
76
|
-
FHE.allowThis(eNumber);
|
|
77
|
-
FHE.allowSender(eNumber);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/// @notice Requests decryption of `eNumber`.
|
|
81
|
-
/// @dev In real CoFHE this is asynchronous; in mocks it is simulated.
|
|
82
|
-
function decrypt() public {
|
|
83
|
-
// The standalone `FHE.decrypt(...)` helper was removed in
|
|
84
|
-
// fhenixprotocol/cofhe-contracts 0.1.3, so we now go through the
|
|
85
|
-
// task manager interface directly.
|
|
86
|
-
ITaskManager(TASK_MANAGER_ADDRESS).createDecryptTask(uint256(numberHash), msg.sender);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/// @notice Reads a decryption result (reverts if not ready depending on implementation).
|
|
90
|
-
function getDecryptResult(euint32 input1) public view returns (uint32) {
|
|
91
|
-
return FHE.getDecryptResult(input1);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/// @notice Reads a decryption result safely, returning a readiness flag.
|
|
95
|
-
function getDecryptResultSafe(euint32 input1) public view returns (uint32 value, bool decrypted) {
|
|
96
|
-
return FHE.getDecryptResultSafe(input1);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/// @notice Publishes a decrypt result for an encrypted handle.
|
|
100
|
-
function publishDecryptResult(euint32 input, uint32 result, bytes memory signature) external {
|
|
101
|
-
FHE.publishDecryptResult(input, result, signature);
|
|
102
|
-
}
|
|
103
|
-
}
|
package/src/TestBed.ts
DELETED
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
// This file is auto-generated by build-artifacts.ts
|
|
2
|
-
import { type MockArtifact } from './types';
|
|
3
|
-
|
|
4
|
-
export const TestBedArtifact = {
|
|
5
|
-
contractName: 'TestBed',
|
|
6
|
-
isFixed: true,
|
|
7
|
-
fixedAddress: '0x0000000000000000000000000000000000005003',
|
|
8
|
-
abi: [
|
|
9
|
-
{
|
|
10
|
-
type: 'function',
|
|
11
|
-
name: 'add',
|
|
12
|
-
inputs: [
|
|
13
|
-
{
|
|
14
|
-
name: 'inNumber',
|
|
15
|
-
type: 'tuple',
|
|
16
|
-
internalType: 'struct InEuint32',
|
|
17
|
-
components: [
|
|
18
|
-
{
|
|
19
|
-
name: 'ctHash',
|
|
20
|
-
type: 'uint256',
|
|
21
|
-
internalType: 'uint256',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: 'securityZone',
|
|
25
|
-
type: 'uint8',
|
|
26
|
-
internalType: 'uint8',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'utype',
|
|
30
|
-
type: 'uint8',
|
|
31
|
-
internalType: 'uint8',
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'signature',
|
|
35
|
-
type: 'bytes',
|
|
36
|
-
internalType: 'bytes',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
outputs: [],
|
|
42
|
-
stateMutability: 'nonpayable',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
type: 'function',
|
|
46
|
-
name: 'decrypt',
|
|
47
|
-
inputs: [],
|
|
48
|
-
outputs: [],
|
|
49
|
-
stateMutability: 'nonpayable',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
type: 'function',
|
|
53
|
-
name: 'eNumber',
|
|
54
|
-
inputs: [],
|
|
55
|
-
outputs: [
|
|
56
|
-
{
|
|
57
|
-
name: '',
|
|
58
|
-
type: 'bytes32',
|
|
59
|
-
internalType: 'euint32',
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
stateMutability: 'view',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
type: 'function',
|
|
66
|
-
name: 'exists',
|
|
67
|
-
inputs: [],
|
|
68
|
-
outputs: [
|
|
69
|
-
{
|
|
70
|
-
name: '',
|
|
71
|
-
type: 'bool',
|
|
72
|
-
internalType: 'bool',
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
stateMutability: 'pure',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
type: 'function',
|
|
79
|
-
name: 'getDecryptResult',
|
|
80
|
-
inputs: [
|
|
81
|
-
{
|
|
82
|
-
name: 'input1',
|
|
83
|
-
type: 'bytes32',
|
|
84
|
-
internalType: 'euint32',
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
outputs: [
|
|
88
|
-
{
|
|
89
|
-
name: '',
|
|
90
|
-
type: 'uint32',
|
|
91
|
-
internalType: 'uint32',
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
stateMutability: 'view',
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
type: 'function',
|
|
98
|
-
name: 'getDecryptResultSafe',
|
|
99
|
-
inputs: [
|
|
100
|
-
{
|
|
101
|
-
name: 'input1',
|
|
102
|
-
type: 'bytes32',
|
|
103
|
-
internalType: 'euint32',
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
outputs: [
|
|
107
|
-
{
|
|
108
|
-
name: 'value',
|
|
109
|
-
type: 'uint32',
|
|
110
|
-
internalType: 'uint32',
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: 'decrypted',
|
|
114
|
-
type: 'bool',
|
|
115
|
-
internalType: 'bool',
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
stateMutability: 'view',
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
type: 'function',
|
|
122
|
-
name: 'increment',
|
|
123
|
-
inputs: [],
|
|
124
|
-
outputs: [],
|
|
125
|
-
stateMutability: 'nonpayable',
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
type: 'function',
|
|
129
|
-
name: 'mul',
|
|
130
|
-
inputs: [
|
|
131
|
-
{
|
|
132
|
-
name: 'inNumber',
|
|
133
|
-
type: 'tuple',
|
|
134
|
-
internalType: 'struct InEuint32',
|
|
135
|
-
components: [
|
|
136
|
-
{
|
|
137
|
-
name: 'ctHash',
|
|
138
|
-
type: 'uint256',
|
|
139
|
-
internalType: 'uint256',
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
name: 'securityZone',
|
|
143
|
-
type: 'uint8',
|
|
144
|
-
internalType: 'uint8',
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: 'utype',
|
|
148
|
-
type: 'uint8',
|
|
149
|
-
internalType: 'uint8',
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
name: 'signature',
|
|
153
|
-
type: 'bytes',
|
|
154
|
-
internalType: 'bytes',
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
outputs: [],
|
|
160
|
-
stateMutability: 'nonpayable',
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
type: 'function',
|
|
164
|
-
name: 'numberHash',
|
|
165
|
-
inputs: [],
|
|
166
|
-
outputs: [
|
|
167
|
-
{
|
|
168
|
-
name: '',
|
|
169
|
-
type: 'bytes32',
|
|
170
|
-
internalType: 'bytes32',
|
|
171
|
-
},
|
|
172
|
-
],
|
|
173
|
-
stateMutability: 'view',
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
type: 'function',
|
|
177
|
-
name: 'publishDecryptResult',
|
|
178
|
-
inputs: [
|
|
179
|
-
{
|
|
180
|
-
name: 'input',
|
|
181
|
-
type: 'bytes32',
|
|
182
|
-
internalType: 'euint32',
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
name: 'result',
|
|
186
|
-
type: 'uint32',
|
|
187
|
-
internalType: 'uint32',
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
name: 'signature',
|
|
191
|
-
type: 'bytes',
|
|
192
|
-
internalType: 'bytes',
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
outputs: [],
|
|
196
|
-
stateMutability: 'nonpayable',
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
type: 'function',
|
|
200
|
-
name: 'setNumber',
|
|
201
|
-
inputs: [
|
|
202
|
-
{
|
|
203
|
-
name: 'inNumber',
|
|
204
|
-
type: 'tuple',
|
|
205
|
-
internalType: 'struct InEuint32',
|
|
206
|
-
components: [
|
|
207
|
-
{
|
|
208
|
-
name: 'ctHash',
|
|
209
|
-
type: 'uint256',
|
|
210
|
-
internalType: 'uint256',
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
name: 'securityZone',
|
|
214
|
-
type: 'uint8',
|
|
215
|
-
internalType: 'uint8',
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
name: 'utype',
|
|
219
|
-
type: 'uint8',
|
|
220
|
-
internalType: 'uint8',
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
name: 'signature',
|
|
224
|
-
type: 'bytes',
|
|
225
|
-
internalType: 'bytes',
|
|
226
|
-
},
|
|
227
|
-
],
|
|
228
|
-
},
|
|
229
|
-
],
|
|
230
|
-
outputs: [],
|
|
231
|
-
stateMutability: 'nonpayable',
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
type: 'function',
|
|
235
|
-
name: 'setNumberTrivial',
|
|
236
|
-
inputs: [
|
|
237
|
-
{
|
|
238
|
-
name: 'inNumber',
|
|
239
|
-
type: 'uint32',
|
|
240
|
-
internalType: 'uint32',
|
|
241
|
-
},
|
|
242
|
-
],
|
|
243
|
-
outputs: [],
|
|
244
|
-
stateMutability: 'nonpayable',
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
type: 'function',
|
|
248
|
-
name: 'sub',
|
|
249
|
-
inputs: [
|
|
250
|
-
{
|
|
251
|
-
name: 'inNumber',
|
|
252
|
-
type: 'tuple',
|
|
253
|
-
internalType: 'struct InEuint32',
|
|
254
|
-
components: [
|
|
255
|
-
{
|
|
256
|
-
name: 'ctHash',
|
|
257
|
-
type: 'uint256',
|
|
258
|
-
internalType: 'uint256',
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
name: 'securityZone',
|
|
262
|
-
type: 'uint8',
|
|
263
|
-
internalType: 'uint8',
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
name: 'utype',
|
|
267
|
-
type: 'uint8',
|
|
268
|
-
internalType: 'uint8',
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
name: 'signature',
|
|
272
|
-
type: 'bytes',
|
|
273
|
-
internalType: 'bytes',
|
|
274
|
-
},
|
|
275
|
-
],
|
|
276
|
-
},
|
|
277
|
-
],
|
|
278
|
-
outputs: [],
|
|
279
|
-
stateMutability: 'nonpayable',
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
type: 'error',
|
|
283
|
-
name: 'InvalidEncryptedInput',
|
|
284
|
-
inputs: [
|
|
285
|
-
{
|
|
286
|
-
name: 'got',
|
|
287
|
-
type: 'uint8',
|
|
288
|
-
internalType: 'uint8',
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
name: 'expected',
|
|
292
|
-
type: 'uint8',
|
|
293
|
-
internalType: 'uint8',
|
|
294
|
-
},
|
|
295
|
-
],
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
type: 'error',
|
|
299
|
-
name: 'SecurityZoneOutOfBounds',
|
|
300
|
-
inputs: [
|
|
301
|
-
{
|
|
302
|
-
name: 'value',
|
|
303
|
-
type: 'int32',
|
|
304
|
-
internalType: 'int32',
|
|
305
|
-
},
|
|
306
|
-
],
|
|
307
|
-
},
|
|
308
|
-
],
|
|
309
|
-
} as const satisfies MockArtifact;
|
|
@@ -1,172 +0,0 @@
|
|
|
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 type InEuint32Struct = {
|
|
24
|
-
ctHash: BigNumberish;
|
|
25
|
-
securityZone: BigNumberish;
|
|
26
|
-
utype: BigNumberish;
|
|
27
|
-
signature: BytesLike;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export type InEuint32StructOutput = [ctHash: bigint, securityZone: bigint, utype: bigint, signature: string] & {
|
|
31
|
-
ctHash: bigint;
|
|
32
|
-
securityZone: bigint;
|
|
33
|
-
utype: bigint;
|
|
34
|
-
signature: string;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export interface TestBedInterface extends Interface {
|
|
38
|
-
getFunction(
|
|
39
|
-
nameOrSignature:
|
|
40
|
-
| 'add'
|
|
41
|
-
| 'decrypt'
|
|
42
|
-
| 'eNumber'
|
|
43
|
-
| 'exists'
|
|
44
|
-
| 'getDecryptResult'
|
|
45
|
-
| 'getDecryptResultSafe'
|
|
46
|
-
| 'increment'
|
|
47
|
-
| 'mul'
|
|
48
|
-
| 'numberHash'
|
|
49
|
-
| 'publishDecryptResult'
|
|
50
|
-
| 'setNumber'
|
|
51
|
-
| 'setNumberTrivial'
|
|
52
|
-
| 'sub'
|
|
53
|
-
): FunctionFragment;
|
|
54
|
-
|
|
55
|
-
encodeFunctionData(functionFragment: 'add', values: [InEuint32Struct]): string;
|
|
56
|
-
encodeFunctionData(functionFragment: 'decrypt', values?: undefined): string;
|
|
57
|
-
encodeFunctionData(functionFragment: 'eNumber', values?: undefined): string;
|
|
58
|
-
encodeFunctionData(functionFragment: 'exists', values?: undefined): string;
|
|
59
|
-
encodeFunctionData(functionFragment: 'getDecryptResult', values: [BytesLike]): string;
|
|
60
|
-
encodeFunctionData(functionFragment: 'getDecryptResultSafe', values: [BytesLike]): string;
|
|
61
|
-
encodeFunctionData(functionFragment: 'increment', values?: undefined): string;
|
|
62
|
-
encodeFunctionData(functionFragment: 'mul', values: [InEuint32Struct]): string;
|
|
63
|
-
encodeFunctionData(functionFragment: 'numberHash', values?: undefined): string;
|
|
64
|
-
encodeFunctionData(functionFragment: 'publishDecryptResult', values: [BytesLike, BigNumberish, BytesLike]): string;
|
|
65
|
-
encodeFunctionData(functionFragment: 'setNumber', values: [InEuint32Struct]): string;
|
|
66
|
-
encodeFunctionData(functionFragment: 'setNumberTrivial', values: [BigNumberish]): string;
|
|
67
|
-
encodeFunctionData(functionFragment: 'sub', values: [InEuint32Struct]): string;
|
|
68
|
-
|
|
69
|
-
decodeFunctionResult(functionFragment: 'add', data: BytesLike): Result;
|
|
70
|
-
decodeFunctionResult(functionFragment: 'decrypt', data: BytesLike): Result;
|
|
71
|
-
decodeFunctionResult(functionFragment: 'eNumber', data: BytesLike): Result;
|
|
72
|
-
decodeFunctionResult(functionFragment: 'exists', data: BytesLike): Result;
|
|
73
|
-
decodeFunctionResult(functionFragment: 'getDecryptResult', data: BytesLike): Result;
|
|
74
|
-
decodeFunctionResult(functionFragment: 'getDecryptResultSafe', data: BytesLike): Result;
|
|
75
|
-
decodeFunctionResult(functionFragment: 'increment', data: BytesLike): Result;
|
|
76
|
-
decodeFunctionResult(functionFragment: 'mul', data: BytesLike): Result;
|
|
77
|
-
decodeFunctionResult(functionFragment: 'numberHash', data: BytesLike): Result;
|
|
78
|
-
decodeFunctionResult(functionFragment: 'publishDecryptResult', data: BytesLike): Result;
|
|
79
|
-
decodeFunctionResult(functionFragment: 'setNumber', data: BytesLike): Result;
|
|
80
|
-
decodeFunctionResult(functionFragment: 'setNumberTrivial', data: BytesLike): Result;
|
|
81
|
-
decodeFunctionResult(functionFragment: 'sub', data: BytesLike): Result;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface TestBed extends BaseContract {
|
|
85
|
-
connect(runner?: ContractRunner | null): TestBed;
|
|
86
|
-
waitForDeployment(): Promise<this>;
|
|
87
|
-
|
|
88
|
-
interface: TestBedInterface;
|
|
89
|
-
|
|
90
|
-
queryFilter<TCEvent extends TypedContractEvent>(
|
|
91
|
-
event: TCEvent,
|
|
92
|
-
fromBlockOrBlockhash?: string | number | undefined,
|
|
93
|
-
toBlock?: string | number | undefined
|
|
94
|
-
): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
95
|
-
queryFilter<TCEvent extends TypedContractEvent>(
|
|
96
|
-
filter: TypedDeferredTopicFilter<TCEvent>,
|
|
97
|
-
fromBlockOrBlockhash?: string | number | undefined,
|
|
98
|
-
toBlock?: string | number | undefined
|
|
99
|
-
): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
100
|
-
|
|
101
|
-
on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
102
|
-
on<TCEvent extends TypedContractEvent>(
|
|
103
|
-
filter: TypedDeferredTopicFilter<TCEvent>,
|
|
104
|
-
listener: TypedListener<TCEvent>
|
|
105
|
-
): Promise<this>;
|
|
106
|
-
|
|
107
|
-
once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
108
|
-
once<TCEvent extends TypedContractEvent>(
|
|
109
|
-
filter: TypedDeferredTopicFilter<TCEvent>,
|
|
110
|
-
listener: TypedListener<TCEvent>
|
|
111
|
-
): Promise<this>;
|
|
112
|
-
|
|
113
|
-
listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
|
|
114
|
-
listeners(eventName?: string): Promise<Array<Listener>>;
|
|
115
|
-
removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
|
|
116
|
-
|
|
117
|
-
add: TypedContractMethod<[inNumber: InEuint32Struct], [void], 'nonpayable'>;
|
|
118
|
-
|
|
119
|
-
decrypt: TypedContractMethod<[], [void], 'nonpayable'>;
|
|
120
|
-
|
|
121
|
-
eNumber: TypedContractMethod<[], [string], 'view'>;
|
|
122
|
-
|
|
123
|
-
exists: TypedContractMethod<[], [boolean], 'view'>;
|
|
124
|
-
|
|
125
|
-
getDecryptResult: TypedContractMethod<[input1: BytesLike], [bigint], 'view'>;
|
|
126
|
-
|
|
127
|
-
getDecryptResultSafe: TypedContractMethod<
|
|
128
|
-
[input1: BytesLike],
|
|
129
|
-
[[bigint, boolean] & { value: bigint; decrypted: boolean }],
|
|
130
|
-
'view'
|
|
131
|
-
>;
|
|
132
|
-
|
|
133
|
-
increment: TypedContractMethod<[], [void], 'nonpayable'>;
|
|
134
|
-
|
|
135
|
-
mul: TypedContractMethod<[inNumber: InEuint32Struct], [void], 'nonpayable'>;
|
|
136
|
-
|
|
137
|
-
numberHash: TypedContractMethod<[], [string], 'view'>;
|
|
138
|
-
|
|
139
|
-
publishDecryptResult: TypedContractMethod<
|
|
140
|
-
[input: BytesLike, result: BigNumberish, signature: BytesLike],
|
|
141
|
-
[void],
|
|
142
|
-
'nonpayable'
|
|
143
|
-
>;
|
|
144
|
-
|
|
145
|
-
setNumber: TypedContractMethod<[inNumber: InEuint32Struct], [void], 'nonpayable'>;
|
|
146
|
-
|
|
147
|
-
setNumberTrivial: TypedContractMethod<[inNumber: BigNumberish], [void], 'nonpayable'>;
|
|
148
|
-
|
|
149
|
-
sub: TypedContractMethod<[inNumber: InEuint32Struct], [void], 'nonpayable'>;
|
|
150
|
-
|
|
151
|
-
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
|
|
152
|
-
|
|
153
|
-
getFunction(nameOrSignature: 'add'): TypedContractMethod<[inNumber: InEuint32Struct], [void], 'nonpayable'>;
|
|
154
|
-
getFunction(nameOrSignature: 'decrypt'): TypedContractMethod<[], [void], 'nonpayable'>;
|
|
155
|
-
getFunction(nameOrSignature: 'eNumber'): TypedContractMethod<[], [string], 'view'>;
|
|
156
|
-
getFunction(nameOrSignature: 'exists'): TypedContractMethod<[], [boolean], 'view'>;
|
|
157
|
-
getFunction(nameOrSignature: 'getDecryptResult'): TypedContractMethod<[input1: BytesLike], [bigint], 'view'>;
|
|
158
|
-
getFunction(
|
|
159
|
-
nameOrSignature: 'getDecryptResultSafe'
|
|
160
|
-
): TypedContractMethod<[input1: BytesLike], [[bigint, boolean] & { value: bigint; decrypted: boolean }], 'view'>;
|
|
161
|
-
getFunction(nameOrSignature: 'increment'): TypedContractMethod<[], [void], 'nonpayable'>;
|
|
162
|
-
getFunction(nameOrSignature: 'mul'): TypedContractMethod<[inNumber: InEuint32Struct], [void], 'nonpayable'>;
|
|
163
|
-
getFunction(nameOrSignature: 'numberHash'): TypedContractMethod<[], [string], 'view'>;
|
|
164
|
-
getFunction(
|
|
165
|
-
nameOrSignature: 'publishDecryptResult'
|
|
166
|
-
): TypedContractMethod<[input: BytesLike, result: BigNumberish, signature: BytesLike], [void], 'nonpayable'>;
|
|
167
|
-
getFunction(nameOrSignature: 'setNumber'): TypedContractMethod<[inNumber: InEuint32Struct], [void], 'nonpayable'>;
|
|
168
|
-
getFunction(nameOrSignature: 'setNumberTrivial'): TypedContractMethod<[inNumber: BigNumberish], [void], 'nonpayable'>;
|
|
169
|
-
getFunction(nameOrSignature: 'sub'): TypedContractMethod<[inNumber: InEuint32Struct], [void], 'nonpayable'>;
|
|
170
|
-
|
|
171
|
-
filters: {};
|
|
172
|
-
}
|