@coti-io/coti-contracts 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/npm-publish.yml +2 -1
- package/CONTRIBUTING.md +2 -2
- package/LICENSE +1 -1
- package/README.md +18 -35
- package/contracts/access/DataPrivacyFramework/extensions/DataPrivacyFrameworkMpc.sol +112 -0
- 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/ShiftTestsContract.sol +126 -0
- 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/contracts/utils/mpc/MpcCore.sol +40 -0
- package/contracts/utils/mpc/MpcInterface.sol +2 -0
- package/hardhat.config.ts +9 -1
- package/package.json +20 -4
- package/test/onboard/AccountOnboard.test.ts +2 -2
- package/test/token/PrivateERC20/PrivateERC20.test.ts +2 -2
- package/test/utils/accounts.ts +2 -2
- package/test/utils/mpc/Precompile.test.ts +24 -2
- package/typechain-types/@openzeppelin/contracts/interfaces/index.ts +0 -2
- package/typechain-types/contracts/GasTest.ts +91 -0
- 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 +7 -0
- package/typechain-types/contracts/token/PrivateERC721/IERC721Errors.ts +69 -0
- package/typechain-types/contracts/token/PrivateERC721/index.ts +1 -0
- package/typechain-types/contracts/utils/mpc/MpcInterface.sol/ExtendedOperations.ts +38 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/index.ts +0 -1
- package/typechain-types/factories/contracts/GasTest__factory.ts +75 -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/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/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 +7 -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/factories/contracts/utils/mpc/MpcInterface.sol/ExtendedOperations__factory.ts +58 -0
- package/typechain-types/hardhat.d.ts +144 -54
- package/typechain-types/index.ts +16 -6
- package/contracts/access/DataPrivacyFramework/README.md +0 -68
- package/contracts/onboard/README.md +0 -65
- 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.
|
|
@@ -1553,6 +1553,16 @@ library MpcCore {
|
|
|
1553
1553
|
Xor(combineEnumsToBytes3(MPC_TYPE.SUINT8_T, MPC_TYPE.SUINT8_T, ARGS.RHS_PUBLIC), gtUint8.unwrap(a), uint256(b)));
|
|
1554
1554
|
}
|
|
1555
1555
|
|
|
1556
|
+
function shl(gtUint8 a, uint8 b) internal returns (gtUint8) {
|
|
1557
|
+
return gtUint8.wrap(ExtendedOperations(address(MPC_PRECOMPILE)).
|
|
1558
|
+
Shl(combineEnumsToBytes3(MPC_TYPE.SUINT8_T, MPC_TYPE.SUINT8_T, ARGS.RHS_PUBLIC), gtUint8.unwrap(a), uint256(b)));
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
function shr(gtUint8 a, uint8 b) internal returns (gtUint8) {
|
|
1562
|
+
return gtUint8.wrap(ExtendedOperations(address(MPC_PRECOMPILE)).
|
|
1563
|
+
Shr(combineEnumsToBytes3(MPC_TYPE.SUINT8_T, MPC_TYPE.SUINT8_T, ARGS.RHS_PUBLIC), gtUint8.unwrap(a), uint256(b)));
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1556
1566
|
function eq(gtUint8 a, uint8 b) internal returns (gtBool) {
|
|
1557
1567
|
return gtBool.wrap(ExtendedOperations(address(MPC_PRECOMPILE)).
|
|
1558
1568
|
Eq(combineEnumsToBytes3(MPC_TYPE.SUINT8_T, MPC_TYPE.SUINT8_T, ARGS.RHS_PUBLIC), gtUint8.unwrap(a), uint256(b)));
|
|
@@ -1661,6 +1671,16 @@ library MpcCore {
|
|
|
1661
1671
|
Xor(combineEnumsToBytes3(MPC_TYPE.SUINT16_T, MPC_TYPE.SUINT16_T, ARGS.RHS_PUBLIC), gtUint16.unwrap(a), uint256(b)));
|
|
1662
1672
|
}
|
|
1663
1673
|
|
|
1674
|
+
function shl(gtUint16 a, uint16 b) internal returns (gtUint16) {
|
|
1675
|
+
return gtUint16.wrap(ExtendedOperations(address(MPC_PRECOMPILE)).
|
|
1676
|
+
Shl(combineEnumsToBytes3(MPC_TYPE.SUINT16_T, MPC_TYPE.SUINT8_T, ARGS.RHS_PUBLIC), gtUint16.unwrap(a), uint256(b)));
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
function shr(gtUint16 a, uint16 b) internal returns (gtUint16) {
|
|
1680
|
+
return gtUint16.wrap(ExtendedOperations(address(MPC_PRECOMPILE)).
|
|
1681
|
+
Shr(combineEnumsToBytes3(MPC_TYPE.SUINT16_T, MPC_TYPE.SUINT8_T, ARGS.RHS_PUBLIC), gtUint16.unwrap(a), uint256(b)));
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1664
1684
|
function eq(gtUint16 a, uint16 b) internal returns (gtBool) {
|
|
1665
1685
|
return gtBool.wrap(ExtendedOperations(address(MPC_PRECOMPILE)).
|
|
1666
1686
|
Eq(combineEnumsToBytes3(MPC_TYPE.SUINT16_T, MPC_TYPE.SUINT16_T, ARGS.RHS_PUBLIC), gtUint16.unwrap(a), uint256(b)));
|
|
@@ -1769,6 +1789,16 @@ library MpcCore {
|
|
|
1769
1789
|
Xor(combineEnumsToBytes3(MPC_TYPE.SUINT32_T, MPC_TYPE.SUINT32_T, ARGS.RHS_PUBLIC), gtUint32.unwrap(a), uint256(b)));
|
|
1770
1790
|
}
|
|
1771
1791
|
|
|
1792
|
+
function shl(gtUint32 a, uint32 b) internal returns (gtUint32) {
|
|
1793
|
+
return gtUint32.wrap(ExtendedOperations(MPC_PRECOMPILE).
|
|
1794
|
+
Shl(combineEnumsToBytes3(MPC_TYPE.SUINT32_T, MPC_TYPE.SUINT32_T, ARGS.RHS_PUBLIC), gtUint32.unwrap(a), uint256(b)));
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
function shr(gtUint32 a, uint32 b) internal returns (gtUint32) {
|
|
1798
|
+
return gtUint32.wrap(ExtendedOperations(MPC_PRECOMPILE).
|
|
1799
|
+
Shr(combineEnumsToBytes3(MPC_TYPE.SUINT32_T, MPC_TYPE.SUINT32_T, ARGS.RHS_PUBLIC), gtUint32.unwrap(a), uint256(b)));
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1772
1802
|
function eq(gtUint32 a, uint32 b) internal returns (gtBool) {
|
|
1773
1803
|
return gtBool.wrap(ExtendedOperations(address(MPC_PRECOMPILE)).
|
|
1774
1804
|
Eq(combineEnumsToBytes3(MPC_TYPE.SUINT32_T, MPC_TYPE.SUINT32_T, ARGS.RHS_PUBLIC), gtUint32.unwrap(a), uint256(b)));
|
|
@@ -1878,6 +1908,16 @@ library MpcCore {
|
|
|
1878
1908
|
Xor(combineEnumsToBytes3(MPC_TYPE.SUINT64_T, MPC_TYPE.SUINT64_T, ARGS.RHS_PUBLIC), gtUint64.unwrap(a), uint256(b)));
|
|
1879
1909
|
}
|
|
1880
1910
|
|
|
1911
|
+
function shl(gtUint64 a, uint64 b) internal returns (gtUint64) {
|
|
1912
|
+
return gtUint64.wrap(ExtendedOperations(address(MPC_PRECOMPILE)).
|
|
1913
|
+
Shl(combineEnumsToBytes3(MPC_TYPE.SUINT64_T, MPC_TYPE.SUINT64_T, ARGS.RHS_PUBLIC), gtUint64.unwrap(a), uint256(b)));
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
function shr(gtUint64 a, uint64 b) internal returns (gtUint64) {
|
|
1917
|
+
return gtUint64.wrap(ExtendedOperations(address(MPC_PRECOMPILE)).
|
|
1918
|
+
Shr(combineEnumsToBytes3(MPC_TYPE.SUINT64_T, MPC_TYPE.SUINT64_T, ARGS.RHS_PUBLIC), gtUint64.unwrap(a), uint256(b)));
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1881
1921
|
function eq(gtUint64 a, uint64 b) internal returns (gtBool) {
|
|
1882
1922
|
return gtBool.wrap(ExtendedOperations(address(MPC_PRECOMPILE)).
|
|
1883
1923
|
Eq(combineEnumsToBytes3(MPC_TYPE.SUINT64_T, MPC_TYPE.SUINT64_T, ARGS.RHS_PUBLIC), gtUint64.unwrap(a), uint256(b)));
|
|
@@ -22,6 +22,8 @@ interface ExtendedOperations {
|
|
|
22
22
|
function And(bytes3 metaData, uint256 lhs, uint256 rhs) external returns (uint256 result);
|
|
23
23
|
function Or(bytes3 metaData, uint256 lhs, uint256 rhs) external returns (uint256 result);
|
|
24
24
|
function Xor(bytes3 metaData, uint256 lhs, uint256 rhs) external returns (uint256 result);
|
|
25
|
+
function Shl(bytes3 metaData, uint256 lhs, uint256 rhs) external returns (uint256 result);
|
|
26
|
+
function Shr(bytes3 metaData, uint256 lhs, uint256 rhs) external returns (uint256 result);
|
|
25
27
|
function Eq(bytes3 metaData, uint256 lhs, uint256 rhs) external returns (uint256 result);
|
|
26
28
|
function Ne(bytes3 metaData, uint256 lhs, uint256 rhs) external returns (uint256 result);
|
|
27
29
|
function Ge(bytes3 metaData, uint256 lhs, uint256 rhs) external returns (uint256 result);
|
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.3",
|
|
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
|
}
|
|
@@ -24,9 +24,9 @@ describe("Account Onboard", function () {
|
|
|
24
24
|
})
|
|
25
25
|
|
|
26
26
|
it('Should successfully onboard the account', async function () {
|
|
27
|
-
const { owner } = deployment
|
|
27
|
+
const { owner, contractAddress } = deployment
|
|
28
28
|
|
|
29
|
-
await owner.generateOrRecoverAes()
|
|
29
|
+
await owner.generateOrRecoverAes(contractAddress)
|
|
30
30
|
|
|
31
31
|
expect(owner.getUserOnboardInfo()?.aesKey).to.not.equal('')
|
|
32
32
|
})
|
|
@@ -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
|
|
package/test/utils/accounts.ts
CHANGED
|
@@ -14,7 +14,7 @@ export async function setupAccounts() {
|
|
|
14
14
|
setEnvValue("PUBLIC_KEYS", `${key1.address},${key2.address}`)
|
|
15
15
|
setEnvValue("SIGNING_KEYS", `${key1.privateKey},${key2.privateKey}`)
|
|
16
16
|
|
|
17
|
-
throw new Error(`Created new random accounts ${key1.address} and ${key2.address}. Please use faucet to fund
|
|
17
|
+
throw new Error(`Created new random accounts ${key1.address} and ${key2.address}. Please use faucet to fund them.`)
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const wallets = pks.map((pk) => new Wallet(pk, provider))
|
|
@@ -39,7 +39,7 @@ export async function setupAccounts() {
|
|
|
39
39
|
|
|
40
40
|
let accounts: Wallet[] = []
|
|
41
41
|
if (userKeys.length !== wallets.length) {
|
|
42
|
-
await (await wallets[0].sendTransaction({ to: wallets[1].address, value: parseEther("0
|
|
42
|
+
await (await wallets[0].sendTransaction({ to: wallets[1].address, value: parseEther("1.0") })).wait()
|
|
43
43
|
|
|
44
44
|
accounts = await Promise.all(wallets.map(async (account, i) => await toAccount(account)))
|
|
45
45
|
setEnvValue("USER_KEYS", accounts.map((a) => a.getUserOnboardInfo()?.aesKey).join(","))
|
|
@@ -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(
|
|
@@ -99,4 +113,12 @@ describe("Precompile", function () {
|
|
|
99
113
|
bit ? bool_b : bool_a,
|
|
100
114
|
bool_a
|
|
101
115
|
)
|
|
116
|
+
buildTest(
|
|
117
|
+
"ShiftTestsContract",
|
|
118
|
+
"shlTest",
|
|
119
|
+
"getAllShiftResults",
|
|
120
|
+
[a, shift],
|
|
121
|
+
...[2, 4, 8, 16].map((x) => BigInt(a << shift) & BigInt(`0x${"f".repeat(x)}`))
|
|
122
|
+
)
|
|
123
|
+
buildTest("ShiftTestsContract", "shrTest", "getResult", params, a >> b)
|
|
102
124
|
})
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import type {
|
|
5
|
+
BaseContract,
|
|
6
|
+
BytesLike,
|
|
7
|
+
FunctionFragment,
|
|
8
|
+
Result,
|
|
9
|
+
Interface,
|
|
10
|
+
ContractRunner,
|
|
11
|
+
ContractMethod,
|
|
12
|
+
Listener,
|
|
13
|
+
} from "ethers";
|
|
14
|
+
import type {
|
|
15
|
+
TypedContractEvent,
|
|
16
|
+
TypedDeferredTopicFilter,
|
|
17
|
+
TypedEventLog,
|
|
18
|
+
TypedListener,
|
|
19
|
+
TypedContractMethod,
|
|
20
|
+
} from "../common";
|
|
21
|
+
|
|
22
|
+
export interface GasTestInterface extends Interface {
|
|
23
|
+
getFunction(nameOrSignature: "test1" | "test2"): FunctionFragment;
|
|
24
|
+
|
|
25
|
+
encodeFunctionData(functionFragment: "test1", values?: undefined): string;
|
|
26
|
+
encodeFunctionData(functionFragment: "test2", values?: undefined): string;
|
|
27
|
+
|
|
28
|
+
decodeFunctionResult(functionFragment: "test1", data: BytesLike): Result;
|
|
29
|
+
decodeFunctionResult(functionFragment: "test2", data: BytesLike): Result;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface GasTest extends BaseContract {
|
|
33
|
+
connect(runner?: ContractRunner | null): GasTest;
|
|
34
|
+
waitForDeployment(): Promise<this>;
|
|
35
|
+
|
|
36
|
+
interface: GasTestInterface;
|
|
37
|
+
|
|
38
|
+
queryFilter<TCEvent extends TypedContractEvent>(
|
|
39
|
+
event: TCEvent,
|
|
40
|
+
fromBlockOrBlockhash?: string | number | undefined,
|
|
41
|
+
toBlock?: string | number | undefined
|
|
42
|
+
): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
43
|
+
queryFilter<TCEvent extends TypedContractEvent>(
|
|
44
|
+
filter: TypedDeferredTopicFilter<TCEvent>,
|
|
45
|
+
fromBlockOrBlockhash?: string | number | undefined,
|
|
46
|
+
toBlock?: string | number | undefined
|
|
47
|
+
): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
48
|
+
|
|
49
|
+
on<TCEvent extends TypedContractEvent>(
|
|
50
|
+
event: TCEvent,
|
|
51
|
+
listener: TypedListener<TCEvent>
|
|
52
|
+
): Promise<this>;
|
|
53
|
+
on<TCEvent extends TypedContractEvent>(
|
|
54
|
+
filter: TypedDeferredTopicFilter<TCEvent>,
|
|
55
|
+
listener: TypedListener<TCEvent>
|
|
56
|
+
): Promise<this>;
|
|
57
|
+
|
|
58
|
+
once<TCEvent extends TypedContractEvent>(
|
|
59
|
+
event: TCEvent,
|
|
60
|
+
listener: TypedListener<TCEvent>
|
|
61
|
+
): Promise<this>;
|
|
62
|
+
once<TCEvent extends TypedContractEvent>(
|
|
63
|
+
filter: TypedDeferredTopicFilter<TCEvent>,
|
|
64
|
+
listener: TypedListener<TCEvent>
|
|
65
|
+
): Promise<this>;
|
|
66
|
+
|
|
67
|
+
listeners<TCEvent extends TypedContractEvent>(
|
|
68
|
+
event: TCEvent
|
|
69
|
+
): Promise<Array<TypedListener<TCEvent>>>;
|
|
70
|
+
listeners(eventName?: string): Promise<Array<Listener>>;
|
|
71
|
+
removeAllListeners<TCEvent extends TypedContractEvent>(
|
|
72
|
+
event?: TCEvent
|
|
73
|
+
): Promise<this>;
|
|
74
|
+
|
|
75
|
+
test1: TypedContractMethod<[], [void], "nonpayable">;
|
|
76
|
+
|
|
77
|
+
test2: TypedContractMethod<[], [void], "nonpayable">;
|
|
78
|
+
|
|
79
|
+
getFunction<T extends ContractMethod = ContractMethod>(
|
|
80
|
+
key: string | FunctionFragment
|
|
81
|
+
): T;
|
|
82
|
+
|
|
83
|
+
getFunction(
|
|
84
|
+
nameOrSignature: "test1"
|
|
85
|
+
): TypedContractMethod<[], [void], "nonpayable">;
|
|
86
|
+
getFunction(
|
|
87
|
+
nameOrSignature: "test2"
|
|
88
|
+
): TypedContractMethod<[], [void], "nonpayable">;
|
|
89
|
+
|
|
90
|
+
filters: {};
|
|
91
|
+
}
|
|
@@ -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(
|