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.Receivercapabilities has the potential to streamline the FT receiving process and minimize transaction failures. - The current
FungibleToken.Receiverinterface only contains thedepositmethod. It does not offer a clear-cut method for knowing theVaulttypes that a particular receiver can receive. To address this issue,getSupportedVaultTypesfunction was suggested. More details can be found in the FLIP
Action Required
- For any custom receivers like
TokenForwarding,FungibleTokenSwitchboardcontract or any resource in other contracts that conformsFungibleToken.Receivershould define agetSupportedVaultTypesfunction to return an array ofVaulttypes that theReceivercan 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.