bitshares-ui: Incorrect implementation of the disable-bit smartcoin issuer permissions & flags?
Describe the bug
The new disable-bit permissions are as follows:
// If one of the following bits is set in asset issuer permissions,
// it means the asset issuer (or owner for bitassets) does NOT have the permission to update
// the corresponding flag, parameters or perform certain actions.
// This is to be compatible with old client software.
// Note: This comment is copied and reformatted above for better Doxygen documentation formatting.
lock_max_supply = 0x200, ///< the max supply of the asset can not be updated
disable_new_supply = 0x400, ///< unable to create new supply for the asset
// For disable_mcr_update, disable_icr_update and disable_mssr_update,
// if one of these is set in asset issuer permissions, and
// - if the bitasset owner has set a value for the corresponding parameter, the value can not be updated,
// - if the bitasset owner has not set a value for the corresponding parameter, the parameter can still be
// updated by the price feed producers.
// Note: This comment is copied and reformatted above for better Doxygen documentation formatting.
disable_mcr_update = 0x800, ///< the bitasset owner can not update MCR, permission only
disable_icr_update = 0x1000, ///< the bitasset owner can not update ICR, permission only
disable_mssr_update = 0x2000, ///< the bitasset owner can not update MSSR, permission only
disable_bsrm_update = 0x4000, ///< the bitasset owner can not update BSRM, permission only
disable_collateral_bidding = 0x8000 ///< Can not bid collateral after a global settlement
So, if my understanding of the above is correct, then the following should be true:
- When the “lock_max_supply” issuer flag is enabled, the asset creator does not have permission to update the “lock_max_supply” flag.
This applies for the rest of these disable-bit flags, so when the toggle is disabled, the flag should become available to edit, right?
When you disable the issuer permission, the corresponding flag is missing, you’re therefore unable to enable the flag to enable the new feature?
To Reproduce Steps to reproduce the behavior:
- Go to the asset creator page.
- Enable smartcoin options
- Go to the issuer permission page, disable severl of these disable-bit issuer permissions.
- Go to the flag page, look for the corresponding flag for the issuer permission you just disabled, it will not be there.
Expected behavior
Unlike the enable-bit issuer permissions, the disable-bit issuer permissions should result in the opposite behaviour in the flags - they should be visible and editable flags when their disable-bit issuer permission has been disabled.
Additional context
Core code reference: https://github.com/bitshares/bitshares-core/blob/3174d22b5267d0057d0857ac53086e9813c8559f/libraries/protocol/include/graphene/protocol/types.hpp#L205
This is the point where the disabled disable-bit permission fails to be included as a configurable flag: https://github.com/bitshares/bitshares-ui/blob/cba882168c99327e068b2ee23e5ccf8d704a589a/app/components/Account/AccountAssetCreate.jsx#L771
The double-negative terminology is confusing.
Misconfiguration of these disable-bit’s corresponding flags could be preventing users from creating new smartcoins.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 22 (22 by maintainers)
Update: fixed some errors in my comment https://github.com/bitshares/bitshares-ui/issues/3732#issuecomment-2365207854, and added more info to some items.
Updated my comment https://github.com/bitshares/bitshares-ui/issues/3732#issuecomment-2365207854 with a full list of asset issuer permissions and flags.
I don’t think wording in the reference UI is perfect, but it is a good start. Thanks. We know the system is complicated and hard to make perfect UI/UX.
Asset Issuer Permissions
???? ???? ???? ???*???? ???? ???? ???10x0001charge_market_feeflag (see the Flags section for more info)???? ???? ???? ???*???? ???? ???? ???00charge_market_feeflag (see the Flags section for more info). Note: if thecharge_market_feeflag is set to0, can no longer start charging market trading fees; if thecharge_market_feeflag is set to non-zero, the market trading fee rates can still be updated to 0 or non-zero at any time so that trading is not charged or charged.???? ???? ???? ??*????? ???? ???? ??1?0x0002white_listflag (see the Flags section for more info)???? ???? ???? ??*????? ???? ???? ??0?0white_listflag (see the Flags section for more info). Note: if thewhite_listflag is set to0, can no longer start enforcing whitelisting or blacklisting; if thewhite_listflag is set to non-zero, can still configure to not enforce whitelisting or blacklisting at any time by clearing the whitelisting and blacklisting authorities.???? ???? ???? ?*?????? ???? ???? ?1??0x0004override_authorityflag (see the Flags section for more info)???? ???? ???? ?*?????? ???? ???? ?0??0override_authorityflag (see the Flags section for more info).???? ???? ???? *??????? ???? ???? 1???0x0008transfer_restrictedflag (see the Flags section for more info)???? ???? ???? *??????? ???? ???? 0???0transfer_restrictedflag (see the Flags section for more info).???? ???? ???* ???????? ???? ???1 ????0x0010disable_force_settleflag (see the Flags section for more info). Please note that this issuer permission only applies to BitAssets and Prediction Markets, for other asset types this issuer permission can only be0and has no meaning.???? ???? ???* ???????? ???? ???0 ????0disable_force_settleflag (see the Flags section for more info). Please note that this issuer permission only applies to BitAssets and Prediction Markets, for other asset types this issuer permission can only be0and has no meaning.???? ???? ??*? ???????? ???? ??1? ????0x00200and has no meaning, and for Prediction Markets this issuer permission can only be non-zero which means global-settlement has to be enabled.???? ???? ??*? ???????? ???? ??0? ????00and has no meaning, and for Prediction Markets this issuer permission can only be non-zero which means global-settlement has to be enabled.???? ???? ?*?? ???????? ???? ?1?? ????0x0040disable_confidentialflag (see the Flags section for more info)???? ???? ?*?? ???????? ???? ?0?? ????0disable_confidentialflag (see the Flags section for more info).???? ???? *??? ???????? ???? 1??? ????0x0080witness_fed_assetflag (see the Flags section for more info). Please note that this issuer permission only applies to BitAssets and Prediction Markets, for other asset types this issuer permission can only be0and has no meaning.???? ???? *??? ???????? ???? 0??? ????0witness_fed_assetflag (see the Flags section for more info). Please note that this issuer permission only applies to BitAssets and Prediction Markets, for other asset types this issuer permission can only be0and has no meaning.???? ???* ???? ???????? ???1 ???? ????0x0100committee_fed_assetflag (see the Flags section for more info). Please note that this issuer permission only applies to BitAssets and Prediction Markets, for other asset types this issuer permission can only be0and has no meaning.???? ???* ???? ???????? ???0 ???? ????0committee_fed_assetflag (see the Flags section for more info). Please note that this issuer permission only applies to BitAssets and Prediction Markets, for other asset types this issuer permission can only be0and has no meaning.???? ??*? ???? ???????? ??1? ???? ????0x0200lock_max_supplyflag (see the Flags section for more info)???? ??*? ???? ???????? ??0? ???? ????0lock_max_supplyflag (see the Flags section for more info).???? ?*?? ???? ???????? ?1?? ???? ????0x0400disable_new_supplyflag (see the Flags section for more info)???? ?*?? ???? ???????? ?0?? ???? ????0disable_new_supplyflag (see the Flags section for more info).???? *??? ???? ???????? 1??? ???? ????0x0800maintenance_collateral_ratioextension of the asset. If a value is set in themaintenance_collateral_ratioextension, it takes precedence over the same parameter suggested by the price feed publishers, otherwise the value suggested by the price feed publishers takes effect. Please note that this issuer permission only applies to BitAssets, for Prediction Markets this issuer permission is ignored (can be either zero or non-zero), and for other asset types this issuer permission can only be0and has no meaning.???? *??? ???? ???????? 0??? ???? ????0maintenance_collateral_ratioextension of the asset. If a value is set in themaintenance_collateral_ratioextension, it takes precedence over the same parameter suggested by the price feed publishers, otherwise the value suggested by the price feed publishers takes effect. Please note that this issuer permission only applies to BitAssets, for Prediction Markets this issuer permission is ignored (can be either zero or non-zero), and for other asset types this issuer permission can only be0and has no meaning.???* ???? ???? ???????1 ???? ???? ????0x1000initial_collateral_ratioextension of the asset. If a value is set in theinitial_collateral_ratioextension, it takes precedence over the same parameter suggested by the price feed publishers, otherwise the value suggested by the price feed publishers takes effect. Please note that this issuer permission only applies to BitAssets, for Prediction Markets this issuer permission is ignored (can be either zero or non-zero), and for other asset types this issuer permission can only be0and has no meaning.???* ???? ???? ???????0 ???? ???? ????0initial_collateral_ratioextension of the asset. If a value is set in theinitial_collateral_ratioextension, it takes precedence over the same parameter suggested by the price feed publishers, otherwise the value suggested by the price feed publishers takes effect. Please note that this issuer permission only applies to BitAssets, for Prediction Markets this issuer permission is ignored (can be either zero or non-zero), and for other asset types this issuer permission can only be0and has no meaning.??*? ???? ???? ??????1? ???? ???? ????0x2000maximum_short_squeeze_ratioextension of the asset. If a value is set in themaximum_short_squeeze_ratioextension, it takes precedence over the same parameter suggested by the price feed publishers, otherwise the value suggested by the price feed publishers takes effect. Please note that this issuer permission only applies to BitAssets, for Prediction Markets this issuer permission is ignored (can be either zero or non-zero), and for other asset types this issuer permission can only be0and has no meaning.??*? ???? ???? ??????0? ???? ???? ????0maximum_short_squeeze_ratioextension of the asset. If a value is set in themaximum_short_squeeze_ratioextension, it takes precedence over the same parameter suggested by the price feed publishers, otherwise the value suggested by the price feed publishers takes effect Please note that this issuer permission only applies to BitAssets, for Prediction Markets this issuer permission is ignored (can be either zero or non-zero), and for other asset types this issuer permission can only be0and has no meaning.?*?? ???? ???? ?????1?? ???? ???? ????0x4000black_swan_response_methodextension of the asset. Please note that this issuer permission only applies to BitAssets, for other asset types (including Prediction Markets) this issuer permission can only be0and has no meaning.?*?? ???? ???? ?????0?? ???? ???? ????0black_swan_response_methodextension of the asset. Please note that this issuer permission only applies to BitAssets, for other asset types (including Prediction Markets) this issuer permission can only be0and has no meaning.*??? ???? ???? ????1??? ???? ???? ????0x8000disable_collateral_biddingflag (see the Flags section for more info). Please note that this issuer permission only applies to BitAssets and Prediction Markets, for other asset types this issuer permission can only be0and has no meaning.*??? ???? ???? ????0??? ???? ???? ????0disable_collateral_biddingflag (see the Flags section for more info). Please note that this issuer permission only applies to BitAssets and Prediction Markets, for other asset types this issuer permission can only be0and has no meaning.Asset Flags
???? ???? ???? ???*???? ???? ???? ???10x0001???? ???? ???? ???*???? ???? ???? ???00???? ???? ???? ??*????? ???? ???? ??1?0x0002???? ???? ???? ??*????? ???? ???? ??0?0???? ???? ???? ?*?????? ???? ???? ?1??0x0004???? ???? ???? ?*?????? ???? ???? ?0??0???? ???? ???? *??????? ???? ???? 1???0x0008???? ???? ???? *??????? ???? ???? 0???0???? ???? ???* ???????? ???? ???1 ????0x00100and has no meaning.???? ???? ???* ???????? ???? ???0 ????00and has no meaning.???? ???? ??*? ???????? ???? ??0? ????0???? ???? ?*?? ???????? ???? ?1?? ????0x0040???? ???? ?*?? ???????? ???? ?0?? ????0???? ???? *??? ???????? ???? 1??? ????0x00800and has no meaning. Please note that thewitness_fed_assetflag andcommittee_fed_assetflag can not both be non-zero.???? ???? *??? ???????? ???? 0??? ????00and has no meaning.???? ???* ???? ???????? ???1 ???? ????0x01000and has no meaning. Please note that thewitness_fed_assetflag andcommittee_fed_assetflag can not both be non-zero.???? ???* ???? ???????? ???0 ???? ????00and has no meaning.???? ??*? ???? ???????? ??1? ???? ????0x0200lock_max_supplyissuer permission is zero, the asset issuer/owner can still update this flag to unlock the maximum supply.???? ??*? ???? ???????? ??0? ???? ????0???? ?*?? ???? ???????? ?1?? ???? ????0x0400???? ?*?? ???? ???????? ?0?? ???? ????0???? *??? ???? ???????? 0??? ???? ????0???* ???? ???? ???????0 ???? ???? ????0??*? ???? ???? ??????0? ???? ???? ????0?*?? ???? ???? ?????0?? ???? ???? ????0*??? ???? ???? ????1??? ???? ???? ????0x80000and has no meaning.*??? ???? ???? ????0??? ???? ???? ????00and has no meaning.I’ve changed the Astro UX to use the same permission/flag wording as the reference UI, minus expanding the acronyms to full wording to avoid translation into incorrect acronym definitions, so the user isn’t affected by the double negative terminology.
Now that I’ve adjusted the issuer permission to the new spec, the above yields:
Not exactly.
Correct. Others should be inline with this narrative.
Not exactly. (Also the same for the following 3.)
Correct.
By default all permissions should be enable. That being said, the enable-bits should all be 1, and the disable-bits should all be 0. (I don’t use “true” or “false” to describe it.)
For permission only bits, the flag can only be set to 0.
https://github.com/bitshares/bitshares-core/blob/d069614135b3e7a3661a0ebb64ee0dc6b4d4b4f4/libraries/protocol/asset_ops.cpp#L287-L289
https://github.com/bitshares/bitshares-core/blob/d069614135b3e7a3661a0ebb64ee0dc6b4d4b4f4/libraries/protocol/asset_ops.cpp#L320-L328