@coti-io/coti-contracts 1.0.8 → 1.1.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.
Files changed (36) hide show
  1. package/contracts/mocks/utils/mpc/Arithmetic128BitTestsContract.sol +260 -0
  2. package/contracts/mocks/utils/mpc/Arithmetic256BitTestsContract.sol +264 -0
  3. package/contracts/mocks/utils/mpc/Bitwise128BitTestsContract.sol +91 -0
  4. package/contracts/mocks/utils/mpc/Bitwise256BitTestsContract.sol +91 -0
  5. package/contracts/mocks/utils/mpc/Comparison128BitTestsContract.sol +158 -0
  6. package/contracts/mocks/utils/mpc/Comparison256BitTestsContract.sol +158 -0
  7. package/contracts/mocks/utils/mpc/Miscellaneous128BitTestsContract.sol +185 -0
  8. package/contracts/mocks/utils/mpc/Miscellaneous256BitTestsContract.sol +190 -0
  9. package/contracts/utils/mpc/MpcCore.sol +2804 -180
  10. package/hardhat.config.ts +6 -2
  11. package/package.json +2 -2
  12. package/test/token/PrivateERC20/PrivateERC20.test.ts +3 -3
  13. package/test/utils/mpc/Unsigned128BitIntegers.test.ts +945 -0
  14. package/test/utils/mpc/Unsigned256BitIntegers.test.ts +1124 -0
  15. package/test/utils/mpc/helpers.ts +77 -0
  16. package/typechain-types/contracts/mocks/utils/mpc/Arithmetic128BitTestsContract.ts +341 -0
  17. package/typechain-types/contracts/mocks/utils/mpc/Arithmetic256BitTestsContract.ts +347 -0
  18. package/typechain-types/contracts/mocks/utils/mpc/Bitwise128BitTestsContract.ts +186 -0
  19. package/typechain-types/contracts/mocks/utils/mpc/Bitwise256BitTestsContract.ts +186 -0
  20. package/typechain-types/contracts/mocks/utils/mpc/Comparison128BitTestsContract.ts +260 -0
  21. package/typechain-types/contracts/mocks/utils/mpc/Comparison256BitTestsContract.ts +260 -0
  22. package/typechain-types/contracts/mocks/utils/mpc/Miscellaneous128BitTestsContract.ts +302 -0
  23. package/typechain-types/contracts/mocks/utils/mpc/Miscellaneous256BitTestsContract.ts +322 -0
  24. package/typechain-types/contracts/mocks/utils/mpc/index.ts +8 -0
  25. package/typechain-types/factories/contracts/mocks/utils/mpc/Arithmetic128BitTestsContract__factory.ts +349 -0
  26. package/typechain-types/factories/contracts/mocks/utils/mpc/Arithmetic256BitTestsContract__factory.ts +364 -0
  27. package/typechain-types/factories/contracts/mocks/utils/mpc/Bitwise128BitTestsContract__factory.ts +182 -0
  28. package/typechain-types/factories/contracts/mocks/utils/mpc/Bitwise256BitTestsContract__factory.ts +182 -0
  29. package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison128BitTestsContract__factory.ts +255 -0
  30. package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison256BitTestsContract__factory.ts +255 -0
  31. package/typechain-types/factories/contracts/mocks/utils/mpc/Miscellaneous128BitTestsContract__factory.ts +332 -0
  32. package/typechain-types/factories/contracts/mocks/utils/mpc/Miscellaneous256BitTestsContract__factory.ts +380 -0
  33. package/typechain-types/factories/contracts/mocks/utils/mpc/index.ts +8 -0
  34. package/typechain-types/hardhat.d.ts +144 -0
  35. package/typechain-types/index.ts +16 -0
  36. package/contracts/package.json +0 -11
package/hardhat.config.ts CHANGED
@@ -5,7 +5,7 @@ import dotenv from "dotenv"
5
5
  dotenv.config()
6
6
 
7
7
  const config: HardhatUserConfig = {
8
- defaultNetwork: "testnet",
8
+ defaultNetwork: "coti-testnet",
9
9
  solidity: {
10
10
  version: "0.8.19",
11
11
  settings: {
@@ -22,10 +22,14 @@ const config: HardhatUserConfig = {
22
22
  }
23
23
  },
24
24
  networks: {
25
- testnet: {
25
+ "coti-testnet": {
26
26
  url: "https://testnet.coti.io/rpc",
27
27
  chainId: 7082400,
28
28
  },
29
+ "coti-mainnet": {
30
+ url: "https://mainnet.coti.io/rpc",
31
+ chainId: 2632500,
32
+ },
29
33
  },
30
34
  mocha: {
31
35
  timeout: 100000000
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coti-io/coti-contracts",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "description": "A library for smart contract development on the COTI network.",
5
5
  "author": "COTI Development",
6
6
  "repository": {
@@ -23,7 +23,7 @@
23
23
  "hardhat": "^2.22.8"
24
24
  },
25
25
  "dependencies": {
26
- "@coti-io/coti-ethers": "^1.0.4",
26
+ "@coti-io/coti-ethers": "^1.0.5",
27
27
  "@openzeppelin/contracts": "^4.9.6",
28
28
  "dotenv": "^16.4.5"
29
29
  }
@@ -295,7 +295,7 @@ describe("Private ERC20", function () {
295
295
 
296
296
  describe('failed transferFrom', async function () {
297
297
  it('rejects transferring to the zero address', async function () {
298
- const itValue = await otherAccount.encryptValue(value, contractAddress, contract["transferFrom(address,address,(uint256,bytes))"].fragment.selector)as itUint
298
+ const itValue = await otherAccount.encryptValue(value, contractAddress, contract["transferFrom(address,address,(uint256,bytes))"].fragment.selector) as itUint
299
299
 
300
300
  await expect(
301
301
  contract
@@ -309,7 +309,7 @@ describe("Private ERC20", function () {
309
309
 
310
310
  describe("transferring more than the owners balance", async function () {
311
311
  before("transferring", async function () {
312
- const itValue = await otherAccount.encryptValue(2n * value, contractAddress, contract["transferFrom(address,address,(uint256,bytes))"].fragment.selector)as itUint
312
+ const itValue = await otherAccount.encryptValue(2n * value, contractAddress, contract["transferFrom(address,address,(uint256,bytes))"].fragment.selector) as itUint
313
313
 
314
314
  const tx = await contract
315
315
  .connect(otherAccount)
@@ -339,7 +339,7 @@ describe("Private ERC20", function () {
339
339
 
340
340
  describe('successful transferFrom', async function () {
341
341
  before('transferring', async function () {
342
- const itValue = await otherAccount.encryptValue(value, contractAddress, contract["transferFrom(address,address,(uint256,bytes))"].fragment.selector)as itUint
342
+ const itValue = await otherAccount.encryptValue(value, contractAddress, contract["transferFrom(address,address,(uint256,bytes))"].fragment.selector) as itUint
343
343
 
344
344
  const tx = await contract
345
345
  .connect(otherAccount)