bitshares / bitshares/bitshares-ui

Incorrect implementation of the disable-bit smartcoin issuer permissions & flags?

Open
#3,732 22 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
520
Forks
575
Avg merge
12h 7m
Merged PRs (30d)
5

Description

**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.

Contributor guide

Open the contributing guide

Research direction

Start at app/components/Account/AccountAssetCreate.jsx around line 771, then reproduce the issue from the asset creator, issuer permission, and flag pages. Check how disabled disable-bit permissions are mapped to configurable flags; done means the corresponding flags remain visible and editable when those permissions are disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
blockchain, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.