We want to let you know that there will be an upgrade to the FungibleToken smart contract standard.
This upgrade adds a new method for receivers to specify the vault types that they can receive. This will not cause a breaking change to any existing deployed Fungible Token contracts or contracts that have types that implement FungibleToken.Receiver
because it includes a default implementation for the method.
Expected dates to get the changes in effect is as follows:
- CanaryNet: Wednesday, March 15th
- Testnet: Thursday, March 16th
And assuming that the upgrades on the canary and testnet go well,
- Mainnet: Wednesday, March 22 (This date may be delayed)
The FungibleToken
code that will be used for the upgrade can be found in this PR.
Note - We are open to changing the timeline if the community provides feedback on the suggested change.
Why This Change is Happening
- Adding type information to
FungibleToken.Receiver
capabilities has the potential to streamline the FT receiving process and minimize transaction failures. - The current
FungibleToken.Receiver
interface only contains thedeposit
method. It does not offer a clear-cut method for knowing theVault
types that a particular receiver can receive. To address this issue,getSupportedVaultTypes
function was suggested. More details can be found in the FLIP
Action Required
- For any custom receivers like
TokenForwarding
,FungibleTokenSwitchboard
contract or any resource in other contracts that conformsFungibleToken.Receiver
should define agetSupportedVaultTypes
function to return an array ofVault
types that theReceiver
can take in thedeposit()
method. Until this change is made, custom receivers will only return an empty dictionary for this method ({}
) as the return value.
The proposed interface features a default implementation of the getSupportedVaultTypes()
function, ensuring that existing FTs will not encounter any breakage and will have a ready-made implementation available. This default implementation also eliminates the need for upgrading existing FTs, but they should still upgrade eventually for clarity purposes.
In this PR, the Flow team has also implemented the getSupportedVaultTypes
function for the FungibleTokenSwitchboard
and TokenForwarding
contracts.
These contracts will be upgraded at the same time as FungibleToken
on their respective networks.
If you have any questions regarding these changes, please ask in the PR comments, on Discord in the #developers channel, or reply here.