@lfdecentralizedtrust/zeto-contracts 0.5.0 → 0.5.1

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 (50) hide show
  1. package/README.md +6 -0
  2. package/config/eip170.ts +30 -0
  3. package/contracts/lib/interfaces/IZetoLockHooks.sol +42 -0
  4. package/contracts/lib/zeto_fungible.sol +9 -17
  5. package/contracts/lib/zeto_lockable.sol +85 -479
  6. package/contracts/lib/zeto_lockable_lib.sol +460 -0
  7. package/contracts/lib/zeto_lockable_storage.sol +43 -0
  8. package/contracts/lib/zeto_non_fungible.sol +8 -16
  9. package/hardhat.config.ts +11 -2
  10. package/ignition/modules/lib/deps.ts +5 -0
  11. package/ignition/modules/test/tendecimals.ts +7 -1
  12. package/ignition/modules/zeto_anon.ts +3 -0
  13. package/ignition/modules/zeto_anon_burnable.ts +3 -0
  14. package/ignition/modules/zeto_anon_enc.ts +3 -0
  15. package/ignition/modules/zeto_anon_enc_nullifier.ts +3 -0
  16. package/ignition/modules/zeto_anon_enc_nullifier_kyc.ts +3 -0
  17. package/ignition/modules/zeto_anon_enc_nullifier_non_repudiation.ts +3 -0
  18. package/ignition/modules/zeto_anon_nullifier.ts +3 -0
  19. package/ignition/modules/zeto_anon_nullifier_burnable.ts +3 -0
  20. package/ignition/modules/zeto_anon_nullifier_kyc.ts +3 -0
  21. package/ignition/modules/zeto_anon_nullifier_qurrency.ts +3 -0
  22. package/ignition/modules/zeto_nf_anon.ts +3 -1
  23. package/ignition/modules/zeto_nf_anon_nullifier.ts +3 -2
  24. package/package.json +4 -2
  25. package/scripts/lib/zeto_libraries.ts +47 -0
  26. package/scripts/tokens/Zeto_Anon.ts +3 -0
  27. package/scripts/tokens/Zeto_AnonBurnable.ts +3 -0
  28. package/scripts/tokens/Zeto_AnonEnc.ts +3 -0
  29. package/scripts/tokens/Zeto_AnonEncNullifier.ts +6 -5
  30. package/scripts/tokens/Zeto_AnonEncNullifierKyc.ts +6 -5
  31. package/scripts/tokens/Zeto_AnonEncNullifierNonRepudiation.ts +6 -5
  32. package/scripts/tokens/Zeto_AnonNullifier.ts +6 -5
  33. package/scripts/tokens/Zeto_AnonNullifierBurnable.ts +6 -5
  34. package/scripts/tokens/Zeto_AnonNullifierKyc.ts +6 -5
  35. package/scripts/tokens/Zeto_AnonNullifierQurrency.ts +6 -7
  36. package/scripts/tokens/Zeto_NfAnon.ts +3 -1
  37. package/scripts/tokens/Zeto_NfAnonNullifier.ts +6 -6
  38. package/test/factory.ts +10 -1
  39. package/test/lib/deploy.ts +2 -0
  40. package/test/lib/eip170.ts +23 -0
  41. package/test/usdc-shielding.ts +0 -1
  42. package/test/zeto_anon_enc.ts +0 -1
  43. package/test/zeto_anon_enc_nullifier.ts +3 -1
  44. package/test/zeto_anon_enc_nullifier_kyc.ts +3 -1
  45. package/test/zeto_anon_enc_nullifier_non_repudiation.ts +3 -1
  46. package/test/zeto_anon_nullifier.ts +0 -1
  47. package/test/zeto_anon_nullifier_kyc.ts +3 -1
  48. package/test/zeto_anon_nullifier_qurrency.ts +3 -1
  49. package/test/zeto_nf_anon.ts +0 -1
  50. package/test/zeto_nf_anon_nullifier.ts +0 -1
@@ -44,7 +44,6 @@ import {
44
44
  } from "./utils";
45
45
  import { Zeto_AnonNullifier } from "../typechain-types";
46
46
  import { deployZeto } from "./lib/deploy";
47
-
48
47
  const USDC_SEPOLIA_ADDRESS = "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238";
49
48
  const TRANSFER_AMOUNT = 1000; // 0.001000 UDSC
50
49
 
@@ -56,7 +56,6 @@ import {
56
56
  calculateCancelHash,
57
57
  } from "./utils";
58
58
  import { deployZeto } from "./lib/deploy";
59
-
60
59
  const poseidonHash = Poseidon.poseidon4;
61
60
 
62
61
  describe("Zeto based fungible token with anonymity and encryption", function () {
@@ -66,7 +66,9 @@ import {
66
66
  import { deployZeto } from "./lib/deploy";
67
67
  const poseidonHash = Poseidon.poseidon4;
68
68
 
69
- describe("Zeto based fungible token with anonymity using nullifiers and encryption", function () {
69
+ describe(
70
+ "Zeto based fungible token with anonymity using nullifiers and encryption",
71
+ function () {
70
72
  let deployer: Signer;
71
73
  let Alice: User;
72
74
  let Bob: User;
@@ -59,7 +59,9 @@ import {
59
59
  import { deployZeto } from "./lib/deploy";
60
60
  const poseidonHash = Poseidon.poseidon4;
61
61
 
62
- describe("Zeto based fungible token with anonymity using nullifiers and encryption with KYC", function () {
62
+ describe(
63
+ "Zeto based fungible token with anonymity using nullifiers and encryption with KYC",
64
+ function () {
63
65
  let deployer: Signer;
64
66
  let Alice: User;
65
67
  let Bob: User;
@@ -57,7 +57,9 @@ import {
57
57
  import { deployZeto } from "./lib/deploy";
58
58
  const poseidonHash = Poseidon.poseidon4;
59
59
 
60
- describe("Zeto based fungible token with anonymity using nullifiers and encryption for non-repudiation", function () {
60
+ describe(
61
+ "Zeto based fungible token with anonymity using nullifiers and encryption for non-repudiation",
62
+ function () {
61
63
  let deployer: Signer;
62
64
  let Alice: User;
63
65
  let Bob: User;
@@ -83,7 +83,6 @@ describe("Zeto based fungible token with anonymity using nullifiers without encr
83
83
  // accommodate for longer block times on public networks
84
84
  this.timeout(120000);
85
85
  }
86
-
87
86
  let [d, a, b, c, e] = await ethers.getSigners();
88
87
  deployer = d;
89
88
  Alice = await newUser(a);
@@ -118,7 +118,9 @@ function encodeLockedProof(proof: any) {
118
118
  );
119
119
  }
120
120
 
121
- describe("Zeto based fungible token with anonymity, KYC, using nullifiers without encryption", function () {
121
+ describe(
122
+ "Zeto based fungible token with anonymity, KYC, using nullifiers without encryption",
123
+ function () {
122
124
  let deployer: Signer;
123
125
  let Alice: User;
124
126
  let Bob: User;
@@ -56,7 +56,9 @@ import {
56
56
  } from "./utils";
57
57
  import { deployZeto } from "./lib/deploy";
58
58
 
59
- describe("Zeto based fungible token with anonymity using nullifiers with Kyber encryption for auditability", function () {
59
+ describe(
60
+ "Zeto based fungible token with anonymity using nullifiers with Kyber encryption for auditability",
61
+ function () {
60
62
  let deployer: Signer;
61
63
  let Alice: User;
62
64
  let Bob: User;
@@ -41,7 +41,6 @@ import {
41
41
  calculateCancelHash,
42
42
  } from "./utils";
43
43
  import { deployZeto } from "./lib/deploy";
44
-
45
44
  describe("Zeto based non-fungible token with anonymity without encryption or nullifiers", function () {
46
45
  let deployer: Signer;
47
46
  let Alice: User;
@@ -43,7 +43,6 @@ import {
43
43
  calculateCancelHash,
44
44
  } from "./utils";
45
45
  import { deployZeto } from "./lib/deploy";
46
-
47
46
  describe("Zeto based non-fungible token with anonymity using nullifiers without encryption", function () {
48
47
  let deployer: Signer;
49
48
  let Alice: User;