# Does Sway have a "fallback" equivalent?

**URL:** <https://forum.fuel.network/t/does-sway-have-a-fallback-equivalent/104>\
**Category:** Sway\
**Created:** [December 7, 2022, 3:53pm UTC](https://forum.fuel.network/t/does-sway-have-a-fallback-equivalent/104 "2022-12-07T15:53:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sarah/32/13_2.png) [@sarah](https://forum.fuel.network/u/sarah)\
**Post date:** [December 7, 2022, 3:53pm UTC](https://forum.fuel.network/t/does-sway-have-a-fallback-equivalent/104/1 "2022-12-07T15:53:52Z")

</div>

Does Sway have a “fallback” equivalent like Solidity?

---

<div class="post-metadata">

**Author:** ![mindtree](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/mindtree/32/5_2.png) [@mindtree](https://forum.fuel.network/u/mindtree)\
**Post date:** [December 8, 2022, 1:57am UTC](https://forum.fuel.network/t/does-sway-have-a-fallback-equivalent/104/2 "2022-12-08T01:57:34Z")

</div>

It sounds like you’re referring to the “fallback function” feature described [here](https://docs.soliditylang.org/en/v0.8.12/contracts.html#fallback-function), is that right?

Currently, we don’t have support for anything like this, and I don’t _think_ we have any plans for something like this at present.

Intuitively, the feature sounds a little messy, in that it invokes a potentially payable contract function for messages that contain arbitrary call data (besides those that match another function).

My _guess_ is that the motivation here is to capture attempts to call older versions of contract functions in newer versions of a contract so that the new contract can emit some event or log, rather than silently revert?

I’m not sure it’s a good idea to encourage contract developers to notify of API changes from the contract itself like this. In the FuelLabs ecosystem, it is the tools used to build and deploy contracts or run scripts (like `forc` or the SDKs) that should be raising the error about ABI incompatibility long before the bytecode makes it to a node for execution and long before any gas is spent.

All that said, I could be overlooking some greater motivating use-case!

---

<div class="post-metadata">

**Author:** ![SwayStar123](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/swaystar123/32/510_2.png) [@SwayStar123](https://forum.fuel.network/u/SwayStar123)\
**Post date:** [December 8, 2022, 4:16am UTC](https://forum.fuel.network/t/does-sway-have-a-fallback-equivalent/104/3 "2022-12-08T04:16:03Z")

</div>

No, at least not currently.

---

<div class="post-metadata">

**Author:** ![sarah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sarah/32/13_2.png) [@sarah](https://forum.fuel.network/u/sarah)\
**Post date:** [February 19, 2023, 5:12am UTC](https://forum.fuel.network/t/does-sway-have-a-fallback-equivalent/104/4 "2023-02-19T05:12:53Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
