@openzeppelin/compact-contracts 0.3.0-rc.1 → 0.4.0-alpha.2

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 (46) hide show
  1. package/README.md +14 -4
  2. package/access/AccessControl.compact +14 -14
  3. package/access/Ownable.compact +16 -10
  4. package/access/ShieldedAccessControl.compact +26 -2
  5. package/access/ZOwnablePK.compact +9 -9
  6. package/crypto/EcdhMask.compact +5 -5
  7. package/crypto/Ecdsa.compact +111 -0
  8. package/crypto/Eip712.compact +168 -0
  9. package/crypto/ElGamal.compact +33 -107
  10. package/multisig/EcdsaSignerManager.compact +246 -0
  11. package/multisig/ForwarderPrivate.compact +12 -6
  12. package/multisig/ForwarderShielded.compact +3 -3
  13. package/multisig/ForwarderUnshielded.compact +3 -3
  14. package/multisig/ProposalManager.compact +195 -23
  15. package/multisig/ShieldedTreasury.compact +29 -2
  16. package/multisig/ShieldedTreasuryStateless.compact +2 -2
  17. package/multisig/Signer.compact +28 -80
  18. package/multisig/UnshieldedTreasury.compact +10 -2
  19. package/multisig/{presets/forwarder/ForwarderPrivate.compact → examples/ForwarderPrivateExample.compact} +4 -4
  20. package/multisig/{presets/forwarder/ForwarderShielded.compact → examples/ForwarderShieldedExample.compact} +4 -4
  21. package/multisig/{presets/forwarder/ForwarderUnshielded.compact → examples/ForwarderUnshieldedExample.compact} +4 -4
  22. package/multisig/examples/NativeShieldedTokenIssuerExample.compact +143 -0
  23. package/multisig/examples/ShieldedMultiSigV2Example.compact +77 -0
  24. package/multisig/presets/NativeShieldedTokenIssuer.compact +542 -0
  25. package/multisig/presets/ShieldedMultiSigV2.compact +267 -259
  26. package/package.json +31 -25
  27. package/security/Allowlist.compact +6 -6
  28. package/security/Blocklist.compact +6 -6
  29. package/security/Initializable.compact +9 -5
  30. package/security/Pausable.compact +11 -7
  31. package/token/ConfidentialFungibleToken.compact +143 -270
  32. package/token/FungibleToken.compact +36 -22
  33. package/token/MultiToken.compact +16 -16
  34. package/token/NativeShieldedToken.compact +17 -66
  35. package/token/NativeShieldedTokenCore.compact +26 -48
  36. package/token/NativeShieldedTokenFamily.compact +17 -67
  37. package/token/NonFungibleToken.compact +40 -79
  38. package/token/extensions/ConfidentialFungibleTokenPublicSupply.compact +12 -7
  39. package/token/extensions/NativeShieldedTokenDerivedNonce.compact +3 -3
  40. package/token/extensions/NativeShieldedTokenFamilyPublicSupply.compact +8 -8
  41. package/token/extensions/NativeShieldedTokenPublicSupply.compact +8 -8
  42. package/token/extensions/NativeShieldedTokenPublicSupplyCore.compact +6 -6
  43. package/utils/EvmAbi.compact +134 -0
  44. package/utils/Utils.compact +2 -12
  45. package/multisig/presets/ShieldedMultiSig.compact +0 -227
  46. package/multisig/presets/ShieldedMultiSigV3.compact +0 -368
@@ -1,7 +1,7 @@
1
1
  // SPDX-License-Identifier: MIT
2
- // OpenZeppelin Compact Contracts v0.3.0-rc.1 (security/Allowlist.compact)
2
+ // OpenZeppelin Compact Contracts v0.4.0-alpha.2 (security/Allowlist.compact)
3
3
 
4
- pragma language_version >= 0.23.0;
4
+ pragma language_version >= 0.26.0;
5
5
 
6
6
  /**
7
7
  * @module Allowlist
@@ -41,7 +41,7 @@ module Allowlist {
41
41
  /**
42
42
  * @description Returns whether `account` is currently allowed.
43
43
  *
44
- * @circuitInfo k=9, rows=305
44
+ * @constraints k=9, rows=303
45
45
  *
46
46
  * @param {Bytes<32>} account - The account to query.
47
47
  * @return {Boolean} - True if `account` is a member of the allowlist.
@@ -58,7 +58,7 @@ module Allowlist {
58
58
  * @description Asserts that `account` is allowed. The composing contract
59
59
  * decides when this gate applies.
60
60
  *
61
- * @circuitInfo k=9, rows=305
61
+ * @constraints k=9, rows=303
62
62
  *
63
63
  * Requirements:
64
64
  *
@@ -78,7 +78,7 @@ module Allowlist {
78
78
  /**
79
79
  * @description Adds `account` to the allowlist.
80
80
  *
81
- * @circuitInfo k=9, rows=303
81
+ * @constraints k=9, rows=301
82
82
  *
83
83
  * @param {Bytes<32>} account - The account to allow.
84
84
  * @return {[]} - Empty tuple.
@@ -90,7 +90,7 @@ module Allowlist {
90
90
  /**
91
91
  * @description Removes `account` from the allowlist.
92
92
  *
93
- * @circuitInfo k=9, rows=303
93
+ * @constraints k=9, rows=301
94
94
  *
95
95
  * @param {Bytes<32>} account - The account to disallow.
96
96
  * @return {[]} - Empty tuple.
@@ -1,7 +1,7 @@
1
1
  // SPDX-License-Identifier: MIT
2
- // OpenZeppelin Compact Contracts v0.3.0-rc.1 (security/Blocklist.compact)
2
+ // OpenZeppelin Compact Contracts v0.4.0-alpha.2 (security/Blocklist.compact)
3
3
 
4
- pragma language_version >= 0.23.0;
4
+ pragma language_version >= 0.26.0;
5
5
 
6
6
  /**
7
7
  * @module Blocklist
@@ -39,7 +39,7 @@ module Blocklist {
39
39
  /**
40
40
  * @description Returns whether `account` is currently blocked.
41
41
  *
42
- * @circuitInfo k=9, rows=305
42
+ * @constraints k=9, rows=303
43
43
  *
44
44
  * @param {Bytes<32>} account - The account to query.
45
45
  * @return {Boolean} - True if `account` is a member of the blocklist.
@@ -56,7 +56,7 @@ module Blocklist {
56
56
  * @description Asserts that `account` is not blocked. The composing contract
57
57
  * decides when this gate applies.
58
58
  *
59
- * @circuitInfo k=9, rows=308
59
+ * @constraints k=9, rows=306
60
60
  *
61
61
  * Requirements:
62
62
  *
@@ -76,7 +76,7 @@ module Blocklist {
76
76
  /**
77
77
  * @description Adds `account` to the blocklist.
78
78
  *
79
- * @circuitInfo k=9, rows=303
79
+ * @constraints k=9, rows=301
80
80
  *
81
81
  * @param {Bytes<32>} account - The account to block.
82
82
  * @return {[]} - Empty tuple.
@@ -88,7 +88,7 @@ module Blocklist {
88
88
  /**
89
89
  * @description Removes `account` from the blocklist.
90
90
  *
91
- * @circuitInfo k=9, rows=303
91
+ * @constraints k=9, rows=301
92
92
  *
93
93
  * @param {Bytes<32>} account - The account to unblock.
94
94
  * @return {[]} - Empty tuple.
@@ -1,7 +1,7 @@
1
1
  // SPDX-License-Identifier: MIT
2
- // OpenZeppelin Compact Contracts v0.3.0-rc.1 (security/Initializable.compact)
2
+ // OpenZeppelin Compact Contracts v0.4.0-alpha.2 (security/Initializable.compact)
3
3
 
4
- pragma language_version >= 0.23.0;
4
+ pragma language_version >= 0.26.0;
5
5
 
6
6
  /**
7
7
  * @module Initializable
@@ -26,12 +26,16 @@ pragma language_version >= 0.23.0;
26
26
  module Initializable {
27
27
  import CompactStandardLibrary;
28
28
 
29
+ /**
30
+ * @description Whether `initialize` has run. Guards against re-initialization
31
+ * and against use before initialization.
32
+ */
29
33
  export ledger _isInitialized: Boolean;
30
34
 
31
35
  /**
32
36
  * @description Initializes the state thus ensuring the calling circuit can only be called once.
33
37
  *
34
- * @circuitInfo k=10, rows=38
38
+ * @constraints k=6, rows=28
35
39
  *
36
40
  * Requirements:
37
41
  *
@@ -47,7 +51,7 @@ module Initializable {
47
51
  /**
48
52
  * @description Asserts that the contract has been initialized, throwing an error if not.
49
53
  *
50
- * @circuitInfo k=10, rows=31
54
+ * @constraints k=6, rows=25
51
55
  *
52
56
  * Requirements:
53
57
  *
@@ -62,7 +66,7 @@ module Initializable {
62
66
  /**
63
67
  * @description Asserts that the contract has not been initialized, throwing an error if it has.
64
68
  *
65
- * @circuitInfo k=10, rows=35
69
+ * @constraints k=6, rows=28
66
70
  *
67
71
  * Requirements:
68
72
  *
@@ -1,7 +1,7 @@
1
1
  // SPDX-License-Identifier: MIT
2
- // OpenZeppelin Compact Contracts v0.3.0-rc.1 (security/Pausable.compact)
2
+ // OpenZeppelin Compact Contracts v0.4.0-alpha.2 (security/Pausable.compact)
3
3
 
4
- pragma language_version >= 0.23.0;
4
+ pragma language_version >= 0.26.0;
5
5
 
6
6
  /**
7
7
  * @module Pausable
@@ -12,12 +12,16 @@ pragma language_version >= 0.23.0;
12
12
  module Pausable {
13
13
  import CompactStandardLibrary;
14
14
 
15
+ /**
16
+ * @description Whether the contract is paused. Consuming contracts gate
17
+ * state-changing circuits on it via `assertPaused` / `assertNotPaused`.
18
+ */
15
19
  export ledger _isPaused: Boolean;
16
20
 
17
21
  /**
18
22
  * @description Returns true if the contract is paused, and false otherwise.
19
23
  *
20
- * @circuitInfo k=10, rows=32
24
+ * @constraints k=6, rows=24
21
25
  *
22
26
  * @return {Boolean} True if paused.
23
27
  */
@@ -28,7 +32,7 @@ module Pausable {
28
32
  /**
29
33
  * @description Makes a circuit only callable when the contract is paused.
30
34
  *
31
- * @circuitInfo k=10, rows=31
35
+ * @constraints k=6, rows=25
32
36
  *
33
37
  * Requirements:
34
38
  *
@@ -43,7 +47,7 @@ module Pausable {
43
47
  /**
44
48
  * @description Makes a circuit only callable when the contract is not paused.
45
49
  *
46
- * @circuitInfo k=10, rows=35
50
+ * @constraints k=6, rows=28
47
51
  *
48
52
  * Requirements:
49
53
  *
@@ -58,7 +62,7 @@ module Pausable {
58
62
  /**
59
63
  * @description Triggers a stopped state.
60
64
  *
61
- * @circuitInfo k=10, rows=38
65
+ * @constraints k=6, rows=28
62
66
  *
63
67
  * Requirements:
64
68
  *
@@ -74,7 +78,7 @@ module Pausable {
74
78
  /**
75
79
  * @description Lifts the pause on the contract.
76
80
  *
77
- * @circuitInfo k=10, rows=34
81
+ * @constraints k=6, rows=25
78
82
  *
79
83
  * Requirements:
80
84
  *