Is there plan to support transfer hook for token (i.e. NFT)? #118
-
AIP-73 supports creator of fungible asset (ERC-20 equivalent on Aptos) to define custom logic at transfer. I wonder what's the plan to token (NFT equivalent on Aptos)? Take ERC-404 as an example, say I create a ERC-404 collection. Each NFT equals to 100 FT. When Alice transfers 100 FT to Bob, she implicitly transfers 1 NFT to Bob. When Alice transfers 1 NFT to Bob, she implicitly transfers 100 FT to Bob. So we need transfer hook on both FT and NFT. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I have a hard time imagining how we can implement transfer hook for NFT. Because for fungible asset, the only way to transfer is to call But for digital asset (NFT), owner can just call |
Beta Was this translation helpful? Give feedback.
-
Discussed internally, we don't have plan for adding it to NFT now. |
Beta Was this translation helpful? Give feedback.
-
Custom transfer logicCustom transfer logic is always possible by using the Keep in mind that this would make custom logic that would need to be handled by wallets or other applications. More info here for an example of a controlled transfer. https://aptos.dev/move/move-on-aptos/objects/configuring-objects#controlled-transfers Overriding the default transferOverriding |
Beta Was this translation helpful? Give feedback.
Custom transfer logic
Custom transfer logic is always possible by using the
TransferRef
to control transfers for NFTs.Keep in mind that this would make custom logic that would need to be handled by wallets or other applications.
More info here for an example of a controlled transfer. https://aptos.dev/move/move-on-aptos/objects/configuring-objects#controlled-transfers
Overriding the default transfer
Overriding
object::transfer
directly is not possible today, but making custom logic like the above is.