Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extensions to several asset operations #2176

Merged
merged 30 commits into from
May 28, 2020
Merged

Conversation

abitmore
Copy link
Member

@abitmore abitmore commented May 14, 2020

For BSIP 48, 75 and 77

Features:

  • price feed producers can publish ICR (supplement to BSIP77)
  • asset owners can update MCR and MSSR directly (BSIP75) (also ICR due to BSIP77)
  • asset precision can be updated when asset has zero supply (BSIP48)
    • precision of prediction markets can't be updated
    • if any other asset is backed by this asset, this asset's precision can't be updated
  • when updating asset, can skip updating CER (core_exchange_rate), this is useful for updating via proposals which take time to approve (may be put into BSIP48)
  • new flags for assets (BSIP48)
    • whether max supply can be updated
    • whether new supply can be created (issued by asset owner for UIAs, or created by borrowers for MPAs/PMs)
  • new asset issuer permissions (to be forfeited by asset owners) (BSIP48/75/77)
    • to update the new "whether max supply can be updated" flag
    • to update the new "whether new supply can be created" flag
    • for MPAs/PMs, to update MCR
    • for MPAs/PMs, to update ICR
    • for MPAs/PMs, to update MSSR
  • fix a bug about flags
    • before the hard fork, unknown bits can be set (to 1) in flags when creating an asset, and can not be unset (to 0) when updating the asset (and the non-buggy part: can not set the unknown bits when updating);
    • after the hard fork, when creating an asset, neither the invalid bits nor the unknown bits can be set in flags;
    • after the hard fork, when updating an asset, neither the invalid bits nor the unknown bits can be set in flags; if a bit was already set, when updating the asset, it must be unset.
  • fix a bug about max_supply
    • before the hard fork, can update an asset's max supply to a number smaller than current supply
    • after the hard fork, can't update an asset's max supply to a number smaller than current supply
  • fix a bug about global_settle permission of prediction markets
    • before the hard fork, the global_settle permission of prediction markets can be disabled via asset_update_operation, if done so, it can't be enabled again if supply is not zero;
    • after the hard fork, when updating a prediction market, the global_settle permission must be enabled in new_options, and it's allowed to be enabled if was disabled before the hard fork.
  • Independent asset creation fee for assets with a prefix

TODO:

  • test case for new precision
  • test case for ICR/MCR/MSSR

@abitmore abitmore force-pushed the pr-bsip75-bitasset-ops branch from 12ddc85 to 7330afe Compare May 15, 2020 15:29
abitmore added 6 commits May 16, 2020 16:26
The new max supply should not be lower than the asset's current supply
The global_settle permission should always be enabled for PM
The old equality function of the price_feed struct was misleading
since it did not compare all member variables.
This commit replaces it with a new member function.
@abitmore abitmore force-pushed the pr-bsip75-bitasset-ops branch from 6d49395 to 5796380 Compare May 17, 2020 00:50
@abitmore abitmore marked this pull request as ready for review May 21, 2020 13:54
@abitmore
Copy link
Member Author

Ready for review.

@abitmore abitmore merged commit 6e532a8 into hardfork May 28, 2020
@abitmore abitmore deleted the pr-bsip75-bitasset-ops branch May 28, 2020 08:11
@abitmore

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants