Royalty feature in smart contract

Hey anyone knows how to add the royalty feature in the smart contract because that’s the main feature of NFT but there is very little clear information on the internet.
Can we create a royalty smart contract so if a user executes on any marketplace still owner will get a royalty on secondary sales?

depending on how you write the smart contract, you could lock the NFT to be tradable only on your preferred marketplace.

I don’t know how you can set royalty fee on a separate marketplace, that all it will do will be to transfer that NFT from one address to another address

I read some articles regarding nft minting smart contracts where they in the contract set royalty fees like in YouTube tutorial video it’s kind of confusing.
Do you have any example marketplace contract where the royalty feature is enabled?
Or lock smart contracts were nft locked for only one marketplace.
Thanks for reply

I don’t have an example now, for locking smart contracts, it has to be a way to block transfer/approve only to normal addresses and not to any smart contract

Ok, no issues I will explore more thanks for your reply let’s see anyone other have interest in this topic

It can be done.

You have to modify the transfer function of the NFT when you deploy the NFT minting smart contract, it’s not a simple thing.

If anyone is interested we can work together on these things as we have good ideas to implement but facing technical issues like these royalties.
@IntrepidShape if you are interested can work together…

Appreciate your reply

Have a read here

This is supposed to be the standard for royalties on the Eth. (It’ll work for every EVM chain that I know of)

Here is an implementation.