Itheum / data-dex

DApp with suite of web3 tools to trade personal data on MultiversX
https://datadex.itheum.io
GNU General Public License v3.0
466 stars 6 forks source link

Bonding admin dashboard #1223

Closed damienen closed 5 months ago

damienen commented 6 months ago

Will attach wireframe privately

fuzzyduke commented 5 months ago

Few observations and clarifications

  1. Failure was encountered below; Data NFT was first penalized 10% then slashed. Relevant failure message required. https://devnet-explorer.multiversx.com/transactions/986a7a6c448025061d3c823b9324699b14812fa26ac84b0b4f650875b07f6ec7

  2. If a claim date is set for owners, this is only effective in the admin as a parameter. There is no current followup claim action implemented.

  3. If a creator has been penalized, the values are stored in the dashboard, is not consumable by the creator.

  4. Claims for creators are yet to be implemented. To test once penalization has been enforced.

damienen commented 5 months ago
fuzzyduke commented 5 months ago
  1. When setting "Maximum slash in percentage" value, there is a validation on the Minimum slashable bond. image
  2. Total Bonded shows as 30k ITHEUM, Is this accurate? image
  3. Renewed a bond for a Data NFT in the creator bonding tab. However the Data NFT does not show in the admin dashboard, image
  4. The bar does not reduce as the score reduces image
  5. After a user withdraw bond for a Data NFT, that NFT is taken out of their bonding tab. In the Admin view the Data NFT is removed as well.
  6. Hardcoded amounts still seen image
Enciusan commented 5 months ago

So, regarding point no. 5, that is the expected behaviour. Once a user withdraw the bound it will disappear from the bonding contract mapping, but you still can trade it on data dex but without a liveliness score.

damienen commented 5 months ago

I think after @bucurdavid's upgrade today it won't disappear from the map anymore

bucurdavid commented 5 months ago

Not really, it's removed from the main mapper, which is used to get all active bonds

fuzzyduke commented 5 months ago

To keep everyone on the same page, a few consolidated feedback below.

  1. If the Bond has been withdrawn by the creator, the data NFT is removed from the bonding tab of the creator and the admin.
  2. If any max slash penalty is more than the available bond then the admin is required to manually penalize. I.e., if the slash is 90% but the previous penalty applied was 15% then the max slash will fail.
  3. "No penalty on early withdrawal" sets the bond to expired; the creator can invoke a full refund.
  4. Compensation self-claim can be tested when claim for owners is implemented.
  5. Math on mint, penalty, slash, early withdrawal(2 scenarios) tested.
  6. Bonding duration vs bond amount tested; for a single duration.
fuzzyduke commented 5 months ago

Attempted to add 10 ITHEUM slashable bond to 3600 seconds entry.

Entries were 3600 seconds with 12 ITHEUM 2 seconds with 14 ITHEUM 1000 seconds with 250 ITHEUM

https://devnet-explorer.multiversx.com/transactions/4964020182bddcae40224d0a2ffd631784a8a34d2a4c9439df9176ba40c3afdc

fuzzyduke commented 5 months ago

Cosmetic:

When mentioning to the user that they can withdraw with no penalty. there can be cases they were penalized for other behavior.

Therefore suggest mentioning there will be no Early withdrawal Penalty instead of just Penalty.

"You can withdraw your full bond with no penalty"

Image

fuzzyduke commented 5 months ago

Upon deleting all period bonding periods and amounts blank page is seen.

Attempted to remove all periods to update the already existing entry for 3600 seconds with 12 ITHEUM and update it to 10 ITHEUM

https://deploy-preview-1252--frosty-hermann-85ca4f.netlify.app/bonding

damienen commented 5 months ago

Should be solved @fuzzyduke

fuzzyduke commented 5 months ago

Item 1

Bonding dashboard is not populating data NFTs. Data NFT minted: https://devnet-explorer.multiversx.com/transactions/6ac9a04bc55daf0c21f22e7690be63f5434916225f7f6d8196ac52966954b1f1

Image

fuzzyduke commented 5 months ago

Item 2

  1. currently withdrawal is set to 50% in admin dashboard
  2. penalty of 30% was applied in admin dashboard to a data NFT.
  3. user attempts to withdraw but sees the below. the user still has 20% withdrawable.

Image

Image

fuzzyduke commented 5 months ago

Item 3

  1. mint Data NFT
  2. apply 9% penalty Image
  3. click withdraw (current early withdraw percent is set to 50%) Image
  4. Upon withdrawing it is seen that 5 ITHEUM is sent back. Only the early withdrawal fees was deducted, not the penalty of .9 https://devnet-explorer.multiversx.com/transactions/b3481e9fde9851df6c02e49377f202ad6f28d400abd2d2a3db4f4cc5dd0e6e35#71ab950d69625d25695d54267d4017ba6d85c215b3aa601f6d1ef77d6c382b64
fuzzyduke commented 5 months ago

Item 4

Was able to apply 5% for penalty on a Data NFT despite the minimum penalty being set to 6%

After applying 5% penalty to the data NFT, 6% was deducted.

Image

damienen commented 5 months ago

Item 3

  1. mint Data NFT
  2. apply 9% penalty Image
  3. click withdraw (current early withdraw percent is set to 50%) Image
  4. Upon withdrawing it is seen that 5 ITHEUM is sent back. Only the early withdrawal fees was deducted, not the penalty of .9 https://devnet-explorer.multiversx.com/transactions/b3481e9fde9851df6c02e49377f202ad6f28d400abd2d2a3db4f4cc5dd0e6e35#71ab950d69625d25695d54267d4017ba6d85c215b3aa601f6d1ef77d6c382b64

Indeed, I can confirm this is the logic of the SC and that this bug is coming from the fact that withdraw is using bond_amount instead of remaining_amount for the withdraw operation: https://github.com/Itheum/core-mx-life-bonding-sc/blob/bb99e6ed0e348177bde61c184d408338258c053c/src/lib.rs#L137