This is a simple implementation of an NFT staking program on Solana that you can use for educational purposes.
Note that a more robust implementation should be used for production. DO NOT DEPLOY THIS ON MAINNET.
Things you could add:
- Constrain it to only work with a single collection - right now you can stake any NFT
- Freeze the NFT rather than transfer it - custodial NFT staking is a somewhat outdated pattern
- Add an actual reward token rather than "points"
- Make a more robust test suite
And so much more...