rmrk-team / rmrk-spec

The RMRK NFT Specification
GNU General Public License v3.0
94 stars 35 forks source link

RIP-0011 #33

Open Yuripetusko opened 2 years ago

Yuripetusko commented 2 years ago

RIP Summary

Invalidate a LIST interaction on a NFT if previous LIST on the same NFT happened within 5 block

RIP Details

This only applies to Substrate system.remark spec of RMRK standard. This is to prevent users from re-listing NFT rapidly and to give any client some time to update

Examples

export const validateMinBlockBetweenEvents = (
  opType: OP_TYPES,
  nft: NFTConsolidated,
  remark: Remark
) => {
  const lastChange = nft.changes
    .filter((change) => change.opType === opType)
    .sort((change, prevChange) => prevChange.block - change.block)?.[0];

  if (!lastChange?.block) {
    return true;
  }

  if (remark.block - lastChange.block < 5) {
    throw new Error(
      `[${OP_TYPES.LIST}] There should be minimum of 5 blocks between last ${opType} interaction: ${remark.remark}`
    );
  }
};

Open Questions

Prior work (optional)

Citations, acknowledgments for inspiration, projects this RIP is emulating, etc.

Impact

This was done in rmrk-tools over a month ago but wasn't reflected in spec

I have done some diffing and no NFT were affected at a time of rmrk-tools change, but since then Adam was running his most dangerous NFT game with rapid relisting. I have notified Other RMRK UIs of a change immediately, but I don't think it was implemented there

yangwao commented 2 years ago

I have notified Other RMRK UIs of a change immediately, but I don't think it was implemented there

Hey, I've found this randomly browsing this repo. Is there any incentivization from RMRK-team to implement this in KodaDot? As we prioritize stuff by grants/bounties so we can cover development and implementations costs on our side, hence our earnings are not enough from fees https://dotscanner.com/kusama/account/CykZSc3szpVd95PmmJ45wE4ez7Vj3xkhRFS9H4U1WdrkaFY to cover development.