What's the best way to customize transfer behavior of fungible asset? #90
-
Asked by
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I'm working on this! See aptos-labs/aptos-core#12490 |
Beta Was this translation helpful? Give feedback.
-
Adding to what Greg said, if you fork the fungible asset module, your asset wouldn't be compatible with the dex on Aptos. Because on Aptos, module is the standard (i.e. only asset created by |
Beta Was this translation helpful? Give feedback.
-
You can make custom transfer functions that must be respected, but they have limited interoperability as the dapp would need to know about this function. @runtian-zhou's proposal would allow overriding the functions thus making discoverability a non-issue.
With @runtian-zhou's change, you would expose your own withdraw and deposit functions that would be picked up by the default withdraw / deposit functions. You would still need the TransferRef to then call into withdraw_with_ref and deposit_with_ref. |
Beta Was this translation helpful? Give feedback.
More concretely:
Today: you cannot customize transfer function on fungible assets, the functionality is defined statically.
In development: Dispatchable Fungible Assets, should allow for the ability to override this configuration.
You can additionally make custom logic, but any dex, wallet, or other system would need to recognize the custom logic.