-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Description
In catapult, mosaic creators should be allowed to set constraints on accounts that can transact with their defined mosaics.
This functionality will be enabled by a new mosaic property
Constrainablethat will be disabled by default. Constraints are undesirable for completely fungible tokens (like XEM).
In order to assign a constraint, a new mosaic constraint transaction is required.
We will be adding a new transaction type MosaicRestrictionTransaction to be defined in catapult-server. With following specificities:
- The mosaic creator of the affected mosaic must be signer of this transaction.
- MosaicRestrictionType is only applicable to global mosaic constraints (0-Address for Target). When setting on specific account, the constraint type must be
EQ.
A constraint will be defined by a list of custom properties as defined in following table (counter-check with catapult-server needed for confirmation.)
Mosaic Address Restriction
- Version:
1 - EntityType:
0x4251
| Field | Type | Description |
|---|---|---|
| mosaicId | MosaicId |
Identifier of the mosaic to which the restriction applies |
| restrictionKey | uint64_t | Restriction key |
| targetAdderss | Address or 0-Address |
Affected address (zero address to set global mosaic instead of account-specific property) |
| previousRestrictionValue | uint64_t | Previous restriction value |
| newRestrictionValue | uint64_t | New restriction value |
Mosaic Global Restriction
- Version:
1 - EntityType:
0x4151
| Field | Type | Description |
|---|---|---|
| mosaicId | MosaicId |
Identifier of the mosaic to which the restriction applies |
| referenceMosaicId | MosaicId |
Identifier of the mosaic providing the restriction key |
| restrictionKey | uint64_t | Restriction key |
| previousRestrictionValue | uint64_t | Previous restriction value |
| previousRestrictionType | MosaicRestrictionType |
Previous restriction type |
| newRestrictionValue | uint64_t | New restriction value |
| newRestrictionType | MosaicRestrictionType |
New restriction type |
MosaicRestrictionType
- value:
uint8_t
| Type | Decimal Value | Description |
|---|---|---|
NONE |
0 |
Uninitialized value indicating no restriction |
EQ |
1 |
Must be exact match |
NE |
2 |
Must not equal |
LT |
3 |
Must be less than |
LE |
4 |
Must be less than or equal |
GT |
5 |
Must be greater than |
GE |
6 |
Must be less than or equal |
MosaicPropertyFlag
- Type:
uint8
A new flagRestrictableis added,
| PropertyName | Value | Description |
|---|---|---|
none |
0x00 |
No flags present |
supplyMutable |
0x01 |
Mosaic supports supply changes even when mosaic owner owns partial supply |
transferable |
0x02 |
Mosaic supports transfers between arbitrary accounts |
restrictable |
0x04 |
Mosaic supports custom restrictions configured by mosaic owner |
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request