Deposit function in new smart contract (Coin vs FungibleAsset) #561
-
Discord user IDNo response Describe your question in detail.Dear Devs! I'm writing a smart contract that accepts different assets, including APT. I have a deposit function. Considering the migration of Coin to FungibleAsset, what should I do?
The function for FungibleAsset:
The function for Coin:
For reference: What error, if any, are you getting?No response What have you tried or looked at? Or how can we reproduce the error?No response Which operating system are you using?macOS Which SDK or tool are you using? (if any)Aptos CLI Describe your environment or tooling in detailNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
A fourth option is to write a single entry function that uses conditionals to check which flow to walk through. 😌 The Fungible Asset flow will be your standard, while the Coin flow will have an additional step of converting the coin to fungible asset using |
Beta Was this translation helpful? Give feedback.
A fourth option is to write a single entry function that uses conditionals to check which flow to walk through. 😌
The Fungible Asset flow will be your standard, while the Coin flow will have an additional step of converting the coin to fungible asset using
coin_to_fungible_asset
(reference) tacked onto the beginning.