@openzeppelin/compact-contracts 0.5.0-alpha.1 → 0.5.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.
- package/README.md +9 -4
- package/access/AccessControl.compact +8 -9
- package/access/Ownable.compact +19 -20
- package/access/ShieldedAccessControl.compact +1 -1
- package/access/ZOwnablePK.compact +3 -3
- package/crypto/Ecdh.compact +1 -1
- package/crypto/EcdhMask.compact +61 -22
- package/crypto/Ecdsa.compact +1 -1
- package/crypto/Eip712.compact +1 -1
- package/crypto/ElGamal.compact +13 -13
- package/math/UintN.compact +82 -0
- package/multisig/ForwarderPrivate.compact +1 -1
- package/multisig/ForwarderShielded.compact +1 -1
- package/multisig/ForwarderUnshielded.compact +1 -1
- package/multisig/ProposalManager.compact +3 -3
- package/multisig/Secp256k1EcdsaMultisig.compact +1 -1
- package/multisig/ShieldedTreasury.compact +1 -1
- package/multisig/ShieldedTreasuryStateless.compact +5 -11
- package/multisig/Signer.compact +1 -1
- package/multisig/UnshieldedTreasury.compact +1 -1
- package/multisig/examples/ForwarderPrivateExample.compact +1 -1
- package/multisig/examples/ForwarderShieldedExample.compact +1 -1
- package/multisig/examples/ForwarderUnshieldedExample.compact +1 -1
- package/multisig/examples/{ShieldedMultiSigV2Example.compact → NativeShieldedStatelessTreasuryExample.compact} +23 -23
- package/multisig/examples/NativeShieldedTokenIssuerExample.compact +1 -1
- package/multisig/presets/NativeShieldedStatelessTreasury.compact +443 -0
- package/multisig/presets/NativeShieldedTokenIssuer.compact +1 -1
- package/package.json +11 -11
- package/security/Allowlist.compact +1 -1
- package/security/Blocklist.compact +1 -1
- package/security/Initializable.compact +1 -1
- package/security/Pausable.compact +1 -1
- package/token/ConfidentialFungibleToken.compact +1 -1
- package/token/ConfidentialNoteFungibleToken.compact +1 -1
- package/token/FungibleToken.compact +34 -30
- package/token/MultiToken.compact +25 -21
- package/token/NativeShieldedToken.compact +2 -2
- package/token/NativeShieldedTokenCore.compact +1 -1
- package/token/NativeShieldedTokenFamily.compact +4 -4
- package/token/NonFungibleToken.compact +26 -22
- package/token/examples/ZOwnableNativeShieldedTokenExample.compact +1 -1
- package/token/extensions/ConfidentialFungibleTokenPublicSupply.compact +1 -1
- package/token/extensions/ConfidentialNoteFungibleTokenDelivery.compact +274 -0
- package/token/extensions/NativeShieldedTokenDerivedNonce.compact +1 -1
- package/token/extensions/NativeShieldedTokenFamilyPublicSupply.compact +1 -1
- package/token/extensions/NativeShieldedTokenPublicSupply.compact +1 -1
- package/token/extensions/NativeShieldedTokenPublicSupplyCore.compact +1 -1
- package/token/presets/ZOwnableNativeShieldedToken.compact +1 -1
- package/utils/EvmAbi.compact +1 -1
- package/utils/Utils.compact +1 -1
- package/multisig/presets/ShieldedMultiSigV2.compact +0 -289
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
// OpenZeppelin Compact Contracts v0.5.0-alpha.
|
|
2
|
+
// OpenZeppelin Compact Contracts v0.5.0-alpha.2 (token/FungibleToken.compact)
|
|
3
3
|
|
|
4
4
|
pragma language_version >= 0.26.0;
|
|
5
5
|
|
|
@@ -22,12 +22,12 @@ pragma language_version >= 0.26.0;
|
|
|
22
22
|
* canonicalized in `balanceOf` and `allowance`. `_spendAllowance` canonicalizes
|
|
23
23
|
* independently to ensure consistent lookups before delegating to `_approve`.
|
|
24
24
|
*
|
|
25
|
-
* @notice
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
25
|
+
* @notice This library has not yet migrated to contract-to-contract (C2C) calls. Thus, the main
|
|
26
|
+
* circuits of this module (`transfer`, `transferFrom`, `_transfer`, `_mint`) reject
|
|
27
|
+
* `ContractAddress` recipients via an `isContract` guard, because a contract that receives tokens
|
|
28
|
+
* currently cannot move them back out. Developers who need to experiment with contract recipients
|
|
29
|
+
* can use the `_unsafe` variants, which skip the guard (the caller accepts that such tokens are
|
|
30
|
+
* stranded until the C2C migration lands).
|
|
31
31
|
*
|
|
32
32
|
* @dev Migration plan (safe -> C2C-capable transfers)
|
|
33
33
|
*
|
|
@@ -39,9 +39,9 @@ pragma language_version >= 0.26.0;
|
|
|
39
39
|
* which is the only kind of upgrade the CMA supports. Widening the types later would instead force
|
|
40
40
|
* a ledger-layout rewrite, which the CMA cannot perform.
|
|
41
41
|
*
|
|
42
|
-
* When C2C lands, an already-deployed token migrates without changing its address or
|
|
43
|
-
* Below, `FN` stands for each guarded circuit (`transfer`, `transferFrom`,
|
|
44
|
-
* and `_unsafeFN` for its unsafe counterpart:
|
|
42
|
+
* When the C2C migration lands, an already-deployed token migrates without changing its address or
|
|
43
|
+
* ledger state. Below, `FN` stands for each guarded circuit (`transfer`, `transferFrom`,
|
|
44
|
+
* `_transfer`, `_mint`) and `_unsafeFN` for its unsafe counterpart:
|
|
45
45
|
*
|
|
46
46
|
* - Minor release: mark `_unsafeFN` deprecated (and emit a warning if possible); keep its
|
|
47
47
|
* implementation intact so existing callers continue to work.
|
|
@@ -269,8 +269,8 @@ module FungibleToken {
|
|
|
269
269
|
*
|
|
270
270
|
* @constraints k=13, rows=3743
|
|
271
271
|
*
|
|
272
|
-
* @notice Transfers to contract addresses are
|
|
273
|
-
*
|
|
272
|
+
* @notice Transfers to contract addresses are disallowed until this library migrates to
|
|
273
|
+
* contract-to-contract calls. This restriction prevents assets from
|
|
274
274
|
* being inadvertently locked in contracts that cannot currently handle token receipt.
|
|
275
275
|
*
|
|
276
276
|
* Requirements:
|
|
@@ -300,9 +300,10 @@ module FungibleToken {
|
|
|
300
300
|
*
|
|
301
301
|
* @constraints k=13, rows=3740
|
|
302
302
|
*
|
|
303
|
-
* @warning Transfers to contract addresses are considered unsafe because
|
|
304
|
-
*
|
|
305
|
-
*
|
|
303
|
+
* @warning Transfers to contract addresses are considered unsafe because this library has not yet
|
|
304
|
+
* migrated to contract-to-contract calls.
|
|
305
|
+
* Tokens sent to a contract address may become irretrievable.
|
|
306
|
+
* Once this library migrates to contract-to-contract calls, this circuit may be deprecated.
|
|
306
307
|
*
|
|
307
308
|
* Requirements:
|
|
308
309
|
*
|
|
@@ -385,8 +386,8 @@ module FungibleToken {
|
|
|
385
386
|
*
|
|
386
387
|
* @constraints k=13, rows=4906
|
|
387
388
|
*
|
|
388
|
-
* @notice Transfers to contract addresses are
|
|
389
|
-
*
|
|
389
|
+
* @notice Transfers to contract addresses are disallowed until this library migrates to
|
|
390
|
+
* contract-to-contract calls. This restriction prevents assets from
|
|
390
391
|
* being inadvertently locked in contracts that cannot currently handle token receipt.
|
|
391
392
|
*
|
|
392
393
|
* Requirements:
|
|
@@ -419,9 +420,10 @@ module FungibleToken {
|
|
|
419
420
|
*
|
|
420
421
|
* @constraints k=13, rows=4903
|
|
421
422
|
*
|
|
422
|
-
* @warning Transfers to contract addresses are considered unsafe because
|
|
423
|
-
*
|
|
424
|
-
*
|
|
423
|
+
* @warning Transfers to contract addresses are considered unsafe because this library has not yet
|
|
424
|
+
* migrated to contract-to-contract calls.
|
|
425
|
+
* Tokens sent to a contract address may become irretrievable.
|
|
426
|
+
* Once this library migrates to contract-to-contract calls, this circuit may be deprecated.
|
|
425
427
|
*
|
|
426
428
|
* Requirements:
|
|
427
429
|
*
|
|
@@ -456,8 +458,8 @@ module FungibleToken {
|
|
|
456
458
|
*
|
|
457
459
|
* @constraints k=12, rows=2125
|
|
458
460
|
*
|
|
459
|
-
* @notice Transfers to contract addresses are
|
|
460
|
-
*
|
|
461
|
+
* @notice Transfers to contract addresses are disallowed until this library migrates to
|
|
462
|
+
* contract-to-contract calls. This restriction prevents assets from
|
|
461
463
|
* being inadvertently locked in contracts that cannot currently handle token receipt.
|
|
462
464
|
*
|
|
463
465
|
* Requirements:
|
|
@@ -489,9 +491,10 @@ module FungibleToken {
|
|
|
489
491
|
*
|
|
490
492
|
* @constraints k=12, rows=2122
|
|
491
493
|
*
|
|
492
|
-
* @warning Transfers to contract addresses are considered unsafe because
|
|
493
|
-
*
|
|
494
|
-
*
|
|
494
|
+
* @warning Transfers to contract addresses are considered unsafe because this library has not yet
|
|
495
|
+
* migrated to contract-to-contract calls.
|
|
496
|
+
* Tokens sent to a contract address may become irretrievable.
|
|
497
|
+
* Once this library migrates to contract-to-contract calls, this circuit may be deprecated.
|
|
495
498
|
*
|
|
496
499
|
* Requirements:
|
|
497
500
|
*
|
|
@@ -567,8 +570,8 @@ module FungibleToken {
|
|
|
567
570
|
*
|
|
568
571
|
* @constraints k=11, rows=1328
|
|
569
572
|
*
|
|
570
|
-
* @notice Transfers to contract addresses are
|
|
571
|
-
*
|
|
573
|
+
* @notice Transfers to contract addresses are disallowed until this library migrates to
|
|
574
|
+
* contract-to-contract calls. This restriction prevents assets from
|
|
572
575
|
* being inadvertently locked in contracts that cannot currently handle token receipt.
|
|
573
576
|
*
|
|
574
577
|
* Requirements:
|
|
@@ -593,9 +596,10 @@ module FungibleToken {
|
|
|
593
596
|
*
|
|
594
597
|
* @constraints k=11, rows=1325
|
|
595
598
|
*
|
|
596
|
-
* @warning Transfers to contract addresses are considered unsafe because
|
|
597
|
-
*
|
|
598
|
-
*
|
|
599
|
+
* @warning Transfers to contract addresses are considered unsafe because this library has not yet
|
|
600
|
+
* migrated to contract-to-contract calls.
|
|
601
|
+
* Tokens sent to a contract address may become irretrievable.
|
|
602
|
+
* Once this library migrates to contract-to-contract calls, this circuit may be deprecated.
|
|
599
603
|
*
|
|
600
604
|
* Requirements:
|
|
601
605
|
*
|
package/token/MultiToken.compact
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
// OpenZeppelin Compact Contracts v0.5.0-alpha.
|
|
2
|
+
// OpenZeppelin Compact Contracts v0.5.0-alpha.2 (token/MultiToken.compact)
|
|
3
3
|
|
|
4
4
|
pragma language_version >= 0.26.0;
|
|
5
5
|
|
|
@@ -49,8 +49,8 @@ pragma language_version >= 0.26.0;
|
|
|
49
49
|
* Since this module does not offer mint or transfer batching,
|
|
50
50
|
* balance batching is also not included at this time.
|
|
51
51
|
*
|
|
52
|
-
* 3. Introspection -
|
|
53
|
-
*
|
|
52
|
+
* 3. Introspection - This library has not yet migrated to contract-to-contract
|
|
53
|
+
* calls, so there are no introspection queries. ERC165 (or an equivalent thereof) is NOT
|
|
54
54
|
* included in the contract.
|
|
55
55
|
*
|
|
56
56
|
* 4. Safe transfers - The lack of an introspection mechanism means
|
|
@@ -93,7 +93,7 @@ pragma language_version >= 0.26.0;
|
|
|
93
93
|
* an `isContract` guard, because a contract that receives tokens currently cannot move them back
|
|
94
94
|
* out. The `_unsafe` variants (`_unsafeTransferFrom`, `_unsafeTransfer`, `_unsafeMint`) skip the
|
|
95
95
|
* guard for callers who need contract recipients (accepting that such tokens are stranded until
|
|
96
|
-
* C2C lands).
|
|
96
|
+
* the C2C migration lands).
|
|
97
97
|
*
|
|
98
98
|
* The recipient type is the final `Either<Bytes<32>, ContractAddress>` from day one, in both
|
|
99
99
|
* circuit signatures and ledger maps. This is deliberate. Midnight's upgrade mechanism, the
|
|
@@ -103,7 +103,8 @@ pragma language_version >= 0.26.0;
|
|
|
103
103
|
* which is the only kind of upgrade the CMA supports. Widening the types later would instead force
|
|
104
104
|
* a ledger-layout rewrite, which the CMA cannot perform.
|
|
105
105
|
*
|
|
106
|
-
* When C2C lands, an already-deployed token migrates without changing its address or
|
|
106
|
+
* When the C2C migration lands, an already-deployed token migrates without changing its address or
|
|
107
|
+
* ledger state:
|
|
107
108
|
*
|
|
108
109
|
* - Minor release: mark the `_unsafe` variants deprecated (and emit a warning if possible); keep
|
|
109
110
|
* their implementation intact so existing callers continue to work.
|
|
@@ -120,7 +121,7 @@ pragma language_version >= 0.26.0;
|
|
|
120
121
|
*
|
|
121
122
|
* - Consider changing the underscore in the internal methods to `unsafe` or
|
|
122
123
|
* adopting dot notation for prefixing imports.
|
|
123
|
-
* - Revise logic once contract-to-contract
|
|
124
|
+
* - Revise logic once this library migrates to contract-to-contract calls.
|
|
124
125
|
*/
|
|
125
126
|
module MultiToken {
|
|
126
127
|
import CompactStandardLibrary;
|
|
@@ -328,8 +329,8 @@ module MultiToken {
|
|
|
328
329
|
* In the case of an external (non-contract) caller, the caller's identity is derived from the `wit_MultiTokenSK`
|
|
329
330
|
* witness as `persistentHash(secretKey)`.
|
|
330
331
|
*
|
|
331
|
-
* @notice Transfers to contract addresses are
|
|
332
|
-
*
|
|
332
|
+
* @notice Transfers to contract addresses are disallowed until this library migrates to
|
|
333
|
+
* contract-to-contract calls. This restriction prevents assets from
|
|
333
334
|
* being inadvertently locked in contracts that cannot currently handle token receipt.
|
|
334
335
|
*
|
|
335
336
|
* @constraints k=13, rows=4833
|
|
@@ -365,8 +366,8 @@ module MultiToken {
|
|
|
365
366
|
* Does not impose restrictions on the caller, making it suitable for composition
|
|
366
367
|
* in higher-level contract logic.
|
|
367
368
|
*
|
|
368
|
-
* @notice Transfers to contract addresses are
|
|
369
|
-
*
|
|
369
|
+
* @notice Transfers to contract addresses are disallowed until this library migrates to
|
|
370
|
+
* contract-to-contract calls. This restriction prevents assets from
|
|
370
371
|
* being inadvertently locked in contracts that cannot currently handle token receipt.
|
|
371
372
|
*
|
|
372
373
|
* @constraints k=12, rows=2381
|
|
@@ -458,9 +459,10 @@ module MultiToken {
|
|
|
458
459
|
* In the case of an external (non-contract) caller, the caller's identity is derived from the `wit_MultiTokenSK`
|
|
459
460
|
* witness as `persistentHash(secretKey)`.
|
|
460
461
|
*
|
|
461
|
-
* @warning Transfers to contract addresses are considered unsafe because
|
|
462
|
-
*
|
|
463
|
-
*
|
|
462
|
+
* @warning Transfers to contract addresses are considered unsafe because this library has not yet
|
|
463
|
+
* migrated to contract-to-contract calls.
|
|
464
|
+
* Tokens sent to a contract address may become irretrievable.
|
|
465
|
+
* Once this library migrates to contract-to-contract calls, this circuit may be deprecated.
|
|
464
466
|
*
|
|
465
467
|
* @constraints k=13, rows=4832
|
|
466
468
|
*
|
|
@@ -500,9 +502,10 @@ module MultiToken {
|
|
|
500
502
|
* Does not impose restrictions on the caller, making it suitable as a low-level
|
|
501
503
|
* building block for advanced contract logic.
|
|
502
504
|
*
|
|
503
|
-
* @warning Transfers to contract addresses are considered unsafe because
|
|
504
|
-
*
|
|
505
|
-
*
|
|
505
|
+
* @warning Transfers to contract addresses are considered unsafe because this library has not yet
|
|
506
|
+
* migrated to contract-to-contract calls.
|
|
507
|
+
* Tokens sent to a contract address may become irretrievable.
|
|
508
|
+
* Once this library migrates to contract-to-contract calls, this circuit may be deprecated.
|
|
506
509
|
*
|
|
507
510
|
* @constraints k=12, rows=2380
|
|
508
511
|
*
|
|
@@ -563,8 +566,8 @@ module MultiToken {
|
|
|
563
566
|
/**
|
|
564
567
|
* @description Creates a `value` amount of tokens of type `id`, and assigns them to `to`.
|
|
565
568
|
*
|
|
566
|
-
* @notice Transfers to contract addresses are
|
|
567
|
-
*
|
|
569
|
+
* @notice Transfers to contract addresses are disallowed until this library migrates to
|
|
570
|
+
* contract-to-contract calls. This restriction prevents assets from
|
|
568
571
|
* being inadvertently locked in contracts that cannot currently handle token receipt.
|
|
569
572
|
*
|
|
570
573
|
* @constraints k=11, rows=1449
|
|
@@ -592,9 +595,10 @@ module MultiToken {
|
|
|
592
595
|
/**
|
|
593
596
|
* @description Unsafe variant of `_mint` which allows transfers to contract addresses.
|
|
594
597
|
*
|
|
595
|
-
* @warning Transfers to contract addresses are considered unsafe because
|
|
596
|
-
*
|
|
597
|
-
*
|
|
598
|
+
* @warning Transfers to contract addresses are considered unsafe because this library has not yet
|
|
599
|
+
* migrated to contract-to-contract calls.
|
|
600
|
+
* Tokens sent to a contract address may become irretrievable.
|
|
601
|
+
* Once this library migrates to contract-to-contract calls, this circuit may be deprecated.
|
|
598
602
|
*
|
|
599
603
|
* @constraints k=11, rows=1448
|
|
600
604
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
// OpenZeppelin Compact Contracts v0.5.0-alpha.
|
|
2
|
+
// OpenZeppelin Compact Contracts v0.5.0-alpha.2 (token/NativeShieldedToken.compact)
|
|
3
3
|
|
|
4
4
|
pragma language_version >= 0.26.0;
|
|
5
5
|
|
|
@@ -62,7 +62,7 @@ pragma language_version >= 0.26.0;
|
|
|
62
62
|
* shared-`Initializable`-flag "one `initialize` per contract" limit no longer
|
|
63
63
|
* applies.)
|
|
64
64
|
*
|
|
65
|
-
* @notice Out of scope (phase two, pending contract-to-contract
|
|
65
|
+
* @notice Out of scope (phase two, pending this library's contract-to-contract migration):
|
|
66
66
|
* `balanceOf`, `allowance`, and transfer mediation are not representable for
|
|
67
67
|
* native shielded UTXOs — once a user holds a coin, the contract cannot observe
|
|
68
68
|
* or restrict its movement.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
// OpenZeppelin Compact Contracts v0.5.0-alpha.
|
|
2
|
+
// OpenZeppelin Compact Contracts v0.5.0-alpha.2 (token/NativeShieldedTokenFamily.compact)
|
|
3
3
|
|
|
4
4
|
pragma language_version >= 0.26.0;
|
|
5
5
|
|
|
@@ -8,8 +8,8 @@ pragma language_version >= 0.26.0;
|
|
|
8
8
|
* @description A module for issuing a FAMILY of native shielded (Zswap)
|
|
9
9
|
* token types from one contract, discriminated by a per-call domain.
|
|
10
10
|
*
|
|
11
|
-
* This flavor exists because of Midnight's composition model:
|
|
12
|
-
* contract-to-contract interaction and
|
|
11
|
+
* This flavor exists because of Midnight's composition model: this library has no
|
|
12
|
+
* contract-to-contract interaction yet and a contract cannot deploy
|
|
13
13
|
* another, so the Ethereum pattern of one token contract per asset (stamped
|
|
14
14
|
* out by a factory) is unavailable. A protocol that issues many related
|
|
15
15
|
* tokens — e.g. a DEX minting one liquidity-share token per pair — must do
|
|
@@ -61,7 +61,7 @@ pragma language_version >= 0.26.0;
|
|
|
61
61
|
* need an on-chain `totalSupply(domain)`; see it for the privacy trade-off it
|
|
62
62
|
* introduces (it makes contract-mediated burn amounts public).
|
|
63
63
|
*
|
|
64
|
-
* @notice Out of scope (phase two, pending contract-to-contract
|
|
64
|
+
* @notice Out of scope (phase two, pending this library's contract-to-contract migration):
|
|
65
65
|
* `balanceOf`, `allowance`, transfer mediation, batch operations, and operator
|
|
66
66
|
* approvals are not representable for native shielded UTXOs — once a user holds
|
|
67
67
|
* a coin, the contract cannot observe or restrict its movement.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
// OpenZeppelin Compact Contracts v0.5.0-alpha.
|
|
2
|
+
// OpenZeppelin Compact Contracts v0.5.0-alpha.2 (token/NonFungibleToken.compact)
|
|
3
3
|
|
|
4
4
|
pragma language_version >= 0.26.0;
|
|
5
5
|
|
|
@@ -24,12 +24,12 @@ pragma language_version >= 0.26.0;
|
|
|
24
24
|
* This is due to encoding limits on the midnight circuit backend:
|
|
25
25
|
* https://github.com/midnightntwrk/compactc/issues/929
|
|
26
26
|
*
|
|
27
|
-
* @notice
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
27
|
+
* @notice This library has not yet migrated to contract-to-contract (C2C) calls. Thus, the main
|
|
28
|
+
* circuits of this module (`transfer`, `transferFrom`, `_transfer`, `_mint`) reject
|
|
29
|
+
* `ContractAddress` recipients via an `isContract` guard, because a contract that receives a token
|
|
30
|
+
* currently cannot move it back out. Developers who need to experiment with contract recipients can
|
|
31
|
+
* use the `_unsafe` variants, which skip the guard (the caller accepts that such tokens are
|
|
32
|
+
* stranded until the C2C migration lands).
|
|
33
33
|
*
|
|
34
34
|
* @dev Migration plan (safe -> C2C-capable `transfer`)
|
|
35
35
|
*
|
|
@@ -41,7 +41,8 @@ pragma language_version >= 0.26.0;
|
|
|
41
41
|
* which is the only kind of upgrade the CMA supports. Widening the types later would instead force
|
|
42
42
|
* a ledger-layout rewrite, which the CMA cannot perform.
|
|
43
43
|
*
|
|
44
|
-
* When C2C lands, an already-deployed token migrates without changing its address or
|
|
44
|
+
* When the C2C migration lands, an already-deployed token migrates without changing its address or
|
|
45
|
+
* ledger state:
|
|
45
46
|
*
|
|
46
47
|
* - Minor release: mark `_unsafeTransfer` deprecated (and emit a warning if possible); keep its
|
|
47
48
|
* implementation intact so existing callers continue to work.
|
|
@@ -437,9 +438,9 @@ module NonFungibleToken {
|
|
|
437
438
|
/**
|
|
438
439
|
* @description Transfers `tokenId` token from `fromAddress` to `to`.
|
|
439
440
|
*
|
|
440
|
-
* @notice Transfers to contract addresses are
|
|
441
|
-
*
|
|
442
|
-
* currently handle token receipt.
|
|
441
|
+
* @notice Transfers to contract addresses are disallowed until this library migrates to
|
|
442
|
+
* contract-to-contract calls. This restriction prevents assets from being inadvertently
|
|
443
|
+
* locked in contracts that cannot currently handle token receipt.
|
|
443
444
|
*
|
|
444
445
|
* In the case of an external (non-contract) caller, the caller's identity is derived from the `wit_NonFungibleTokenSK`
|
|
445
446
|
* witness as `persistentHash(secretKey)`.
|
|
@@ -478,9 +479,10 @@ module NonFungibleToken {
|
|
|
478
479
|
* In the case of an external (non-contract) caller, the caller's identity is derived from the `wit_NonFungibleTokenSK`
|
|
479
480
|
* witness as `persistentHash(secretKey)`.
|
|
480
481
|
*
|
|
481
|
-
* @warning Transfers to contract addresses are considered unsafe because
|
|
482
|
-
*
|
|
483
|
-
*
|
|
482
|
+
* @warning Transfers to contract addresses are considered unsafe because this library has not yet
|
|
483
|
+
* migrated to contract-to-contract calls.
|
|
484
|
+
* Tokens sent to a contract address may become irretrievable.
|
|
485
|
+
* Once this library migrates to contract-to-contract calls, this circuit may be deprecated.
|
|
484
486
|
*
|
|
485
487
|
* @constraints k=13, rows=4699
|
|
486
488
|
*
|
|
@@ -706,9 +708,10 @@ module NonFungibleToken {
|
|
|
706
708
|
* - `tokenId` must not exist.
|
|
707
709
|
* - `to` is not zero.
|
|
708
710
|
*
|
|
709
|
-
* @warning Transfers to contract addresses are considered unsafe because
|
|
710
|
-
*
|
|
711
|
-
*
|
|
711
|
+
* @warning Transfers to contract addresses are considered unsafe because this library has not yet
|
|
712
|
+
* migrated to contract-to-contract calls.
|
|
713
|
+
* Tokens sent to a contract address may become irretrievable.
|
|
714
|
+
* Once this library migrates to contract-to-contract calls, this circuit may be deprecated.
|
|
712
715
|
*
|
|
713
716
|
* @param {Either<Bytes<32>, ContractAddress>} to - The account receiving `tokenId`
|
|
714
717
|
* @param {Uint<128>} tokenId - The token to transfer
|
|
@@ -752,8 +755,8 @@ module NonFungibleToken {
|
|
|
752
755
|
* @description Transfers `tokenId` from `fromAddress` to `to`.
|
|
753
756
|
* As opposed to {transferFrom}, this imposes no restrictions on the caller's identity.
|
|
754
757
|
*
|
|
755
|
-
* @notice Transfers to contract addresses are
|
|
756
|
-
*
|
|
758
|
+
* @notice Transfers to contract addresses are disallowed until this library migrates to
|
|
759
|
+
* contract-to-contract calls. This restriction prevents assets from being inadvertently
|
|
757
760
|
* locked in contracts that cannot currently handle token receipt.
|
|
758
761
|
*
|
|
759
762
|
* @constraints k=11, rows=1982
|
|
@@ -795,9 +798,10 @@ module NonFungibleToken {
|
|
|
795
798
|
* - `to` is not zero.
|
|
796
799
|
* - `tokenId` token must be owned by `fromAddress`.
|
|
797
800
|
*
|
|
798
|
-
* @warning Transfers to contract addresses are considered unsafe because
|
|
799
|
-
*
|
|
800
|
-
*
|
|
801
|
+
* @warning Transfers to contract addresses are considered unsafe because this library has not yet
|
|
802
|
+
* migrated to contract-to-contract calls.
|
|
803
|
+
* Tokens sent to a contract address may become irretrievable.
|
|
804
|
+
* Once this library migrates to contract-to-contract calls, this circuit may be deprecated.
|
|
801
805
|
*
|
|
802
806
|
* @param {Either<Bytes<32>, ContractAddress>} fromAddress - The source account of the token transfer
|
|
803
807
|
* @param {Either<Bytes<32>, ContractAddress>} to - The target account of the token transfer
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
// OpenZeppelin Compact Contracts v0.5.0-alpha.
|
|
2
|
+
// OpenZeppelin Compact Contracts v0.5.0-alpha.2 (token/examples/ZOwnableNativeShieldedTokenExample.compact)
|
|
3
3
|
|
|
4
4
|
pragma language_version >= 0.26.0;
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
// OpenZeppelin Compact Contracts v0.5.0-alpha.
|
|
2
|
+
// OpenZeppelin Compact Contracts v0.5.0-alpha.2 (token/extensions/ConfidentialFungibleTokenPublicSupply.compact)
|
|
3
3
|
|
|
4
4
|
pragma language_version >= 0.26.0;
|
|
5
5
|
|