sunrise-stake / app

A proxy around Solana Stake Pools that diverts yield to public goods programs
https://app.sunrisestake.com
12 stars 5 forks source link

Lock&Mint Support NFT transfers properly #256

Open dankelleher opened 1 year ago

dankelleher commented 1 year ago

There is an issue at present with Impact NFTs when they are transferred out of the wallet:

  1. The UI does not recognise the fact that the user does not have an nft and just shows the tree plus the upgrade / unlock buttons but no text etc explaining things

  2. You can upgrade an NFT you don't own :)

https://github.com/sunrise-stake/app/assets/5008805/2c51877e-c0be-4782-83f7-98c324586ea4 The NFT was upgraded, but it was in someone else's wallet! civic.me/BJ6kkXomqSJ41KjugATqsUFsKvpGStgRoNVPGKzbhak6 IMAGE 2023-05-12 14:55:49

  1. You cannot create a new impact nft

The mint address of the nft is derived from the address of the person it was created for, and the upgrade program updates the metadata of that particular mint address, so even though the creator no longer has the nft, upgrading their lock account will always update that particular nft.

We should decide, is a lock account intrinsically linked to the NFT or is it intrinsically linked to the owner? Theoretically, we could link it to the NFT, and require that the lock account change hands when the NFT changes hands. This would not happen at transfer time, but if the minter or the recipient go to sunrise, they could be shown a UI that asks them to move the lock account over.

e.g.

Creator has no NFT but has a lock account. Instead of showing Update/Unlock, as now, instead show "You have transferred the impact nft - move the details of your accrued yield to the new owner". This should be the only thing you can do.

Recipient has an NFT but no lock account (so we don't know what the yield is etc). Again show a button "Transfer the accrued yield details from the original owner"

Question - can we replace the lock account with a bunch of on-chain metadata fields? Then none of the above would be needed