# The Great Interface Migration

**URL:** <https://community.starknet.io/t/the-great-interface-migration/92107>\
**Category:** 📜 Development Proposals\
**Created:** [May 12, 2023, 7:41pm UTC](https://community.starknet.io/t/the-great-interface-migration/92107 "2023-05-12T19:41:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![martriay](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/martriay/32/25_2.png) [@martriay](https://community.starknet.io/u/martriay)\
**Post date:** [May 12, 2023, 7:41pm UTC](https://community.starknet.io/t/the-great-interface-migration/92107/1 "2023-05-12T19:41:12Z")

</div>

# The problem

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/starknet1/original/3X/0/c/0cb152bd6d0d5312dc3538e7156ea78aacb36ee8.jpeg)

The Cairo community has been experiencing a huge lack of consistency across projects, interfaces, and coding styles ([1](https://docs.openzeppelin.com/contracts-cairo/0.6.1/extensibility#function_names_and_coding_style), [2](https://medium.com/nethermind-eth/cairo-coding-guidelines-74eb6f4ee264), [3](https://hackmd.io/@0xHyoga/BkKhLIMJi#Naming-Style), [4](https://github.com/milancermak/cairopractice/blob/baefde6fa9464aaf6eca999a7a7d7044a7da8e41/2022-08-25-cairo-conventions/CairoConventions.md), [5](https://github.com/onlydustxyz/development-guidelines/blob/main/starknet/README.md), […?](https://xkcd.com/927/)).

# A solution

The consensus was to follow `snake_case` since that was the final choice made by Cairo 1.0. Now, the hard part:

* * *

This is the migration plan for OpenZeppelin Contracts for Cairo. Users of the library are encouraged to follow along a two-step process consisting of three stages:

- Stage 0: current situation
- Stage 1: support both interfaces
- Stage 2: phase out camelCase, snakes all over

Although this migration plan is for OpenZeppelin Contracts, we strongly encourage the wider StarkNet ecosystem to follow along with non-OpenZeppelin interfaces as well.

## Stage 0: snaMel or penguin\_Case

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/starknet1/original/3X/1/1/116c777902703077f7cfbac3b0d8b3effec7d7ab.jpeg)

This is were we’re at today. Most contracts are Cairo 0.x and they will have to keep up with regenesis, either by upgrading or through alternative migration paths.

These forced updates are the perfect wave for this migration to ride.

## Stage 1: dual interfaces

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/starknet1/original/3X/7/5/75bc2d0bc88e38e486706fc577ab0f4ef1407919.jpeg)

Leveraging the forced migration, OpenZeppelin Contracts for Cairo will provide a library that:

- exposes both `snake_case` and `camelCase` interfaces
- calls both `snake_case` and `camelCase` functions on other contracts

The latter would be done by attempting the `snake_case` function first (incentivizing optimizoors to favor the preferred casing), and try with `camelCase` before finally reverting. Such fallback mechanism should also be available as a module for other contracts to call (e.g. call `ERC20::transfer_from()` and let the dispatcher resolve the right casing, similar to Solidity’s [SafeERC20](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/1642b6639b93e3b97be163d49827e1f56b81ca11/contracts/token/ERC20/utils/SafeERC20.sol)).

This way, contracts will be compatible with old and new interfaces. Users are encouraged to deploy Stage 1 contracts before regenesis in preparation for Stage 2.

## Stage 2: snakes all over

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/starknet1/original/3X/0/3/036269eb58dec819432292e2d33764f52c9c16ba.jpeg)

After a TBD period of time, most probably after regenesis, the library will drop `camelCase`:

- exposing only `snake_case` interfaces
- calling only `snake_case` functions on other contracts

Since Stage 1 provided full compatibility with both interfaces, there’s no need or rush to upgrade or migrate existing contracts to this version. It’s up to users to evaluate case by case whether it’s safe to do so.

We expect the community to eventually phase out of using `camelCase` at its own pace.

# Opening up the discussion

This is a forum topic and not a blog post because we’re interested in your thoughts and ideas. Does this work for you? how can we make this as seamless and easy as possible?

---

<div class="post-metadata">

**Author:** ![Sidius](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/sidius/32/47070_2.png) [@Sidius](https://community.starknet.io/u/Sidius)\
**Post date:** [May 16, 2023, 9:53am UTC](https://community.starknet.io/t/the-great-interface-migration/92107/2 "2023-05-16T09:53:12Z")

</div>

I think we should just move to stage 2 directly, SithSwap will use snake\_case only in the Cairo1 deployment

---

<div class="post-metadata">

**Author:** ![martriay](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/martriay/32/25_2.png) [@martriay](https://community.starknet.io/u/martriay)\
**Post date:** [May 16, 2023, 7:43pm UTC](https://community.starknet.io/t/the-great-interface-migration/92107/3 "2023-05-16T19:43:33Z")

</div>

I don’t think that’s possible, projects won’t upgrade at the same time, not even if they somehow do it in the same block. We need to maximize stability and interoperability.

---

<div class="post-metadata">

**Author:** ![glihm](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/glihm/32/73137_2.png) [@glihm](https://community.starknet.io/u/glihm)\
**Post date:** [October 12, 2024, 1:16am UTC](https://community.starknet.io/t/the-great-interface-migration/92107/4 "2024-10-12T01:16:30Z")

</div>

Would be a good moment to initiate the phase 2, ecosystem, wise. Should we open a new thread or revive this one?

It becomes more and more crucial as starknet is expanding and more contracts are being deployed.

---

<div class="post-metadata">

**Author:** ![estheroche](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/estheroche/32/85345_2.png) [@estheroche](https://community.starknet.io/u/estheroche)\
**Post date:** [October 13, 2024, 8:45am UTC](https://community.starknet.io/t/the-great-interface-migration/92107/5 "2024-10-13T08:45:53Z")

</div>

let move to phase 2 already

---

<div class="post-metadata">

**Author:** ![Joy-Adah](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/joy-adah/32/85402_2.png) [@Joy-Adah](https://community.starknet.io/u/Joy-Adah)\
**Post date:** [October 15, 2024, 3:18pm UTC](https://community.starknet.io/t/the-great-interface-migration/92107/6 "2024-10-15T15:18:29Z")

</div>

This is the perfect time to move to phase 2!

---

<div class="post-metadata">

**Author:** ![Immanuelolivia1](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/immanuelolivia1/32/85409_2.png) [@Immanuelolivia1](https://community.starknet.io/u/Immanuelolivia1)\
**Post date:** [October 19, 2024, 7:31am UTC](https://community.starknet.io/t/the-great-interface-migration/92107/7 "2024-10-19T07:31:44Z")

</div>

One question I’d pose is how long Stage 1 will be maintained. Setting clear timelines might help developers plan for the switch and avoid extending the dual-support indefinitely, which could become a maintenance burden. Overall, it’s a strong approach that respects both legacy code and future standards.

---

<div class="post-metadata">

**Author:** ![estheroche](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/estheroche/32/85345_2.png) [@estheroche](https://community.starknet.io/u/estheroche)\
**Post date:** [October 24, 2024, 11:08am UTC](https://community.starknet.io/t/the-great-interface-migration/92107/8 "2024-10-24T11:08:39Z")

</div>

i feel using both interfaces will be confusing sometimes, so its better to phase out camelCase, and move to snakes all over

---

<div class="post-metadata">

**Author:** ![robertkodra](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/robertkodra/32/85379_2.png) [@robertkodra](https://community.starknet.io/u/robertkodra)\
**Post date:** [October 31, 2024, 11:38am UTC](https://community.starknet.io/t/the-great-interface-migration/92107/9 "2024-10-31T11:38:31Z")

</div>

+1, let’s initiate Phase 2 and enforce snake case. 🐍

Do you want to start a thread? 👀

---

<div class="post-metadata">

**Author:** ![estheroche](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/estheroche/32/85345_2.png) [@estheroche](https://community.starknet.io/u/estheroche)\
**Post date:** [November 11, 2024, 1:38am UTC](https://community.starknet.io/t/the-great-interface-migration/92107/10 "2024-11-11T01:38:14Z")

</div>

I agree with you, let’s initiate Phase 2 and enforce snake case

---

<div class="post-metadata">

**Author:** ![glihm](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/glihm/32/73137_2.png) [@glihm](https://community.starknet.io/u/glihm)\
**Post date:** [November 13, 2024, 3:03pm UTC](https://community.starknet.io/t/the-great-interface-migration/92107/11 "2024-11-13T15:03:33Z")

</div>

Should we do a SNIP actually? To have something well defined and in the standards that have to be implemented by starknet contracts?

---

<div class="post-metadata">

**Author:** ![estheroche](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/estheroche/32/85345_2.png) [@estheroche](https://community.starknet.io/u/estheroche)\
**Post date:** [November 19, 2024, 1:52pm UTC](https://community.starknet.io/t/the-great-interface-migration/92107/12 "2024-11-19T13:52:58Z")

</div>

Starknet already has SNIP, for the standards

---

<div class="post-metadata">

**Author:** ![glihm](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/glihm/32/73137_2.png) [@glihm](https://community.starknet.io/u/glihm)\
**Post date:** [November 20, 2024, 11:38pm UTC](https://community.starknet.io/t/the-great-interface-migration/92107/13 "2024-11-20T23:38:40Z")

</div>

Oh yeah yeah, I was referring to the idea of creating a SNIP just for naming standards. 🙂

---

<div class="post-metadata">

**Author:** ![estheroche](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/estheroche/32/85345_2.png) [@estheroche](https://community.starknet.io/u/estheroche)\
**Post date:** [November 21, 2024, 6:33am UTC](https://community.starknet.io/t/the-great-interface-migration/92107/14 "2024-11-21T06:33:27Z")

</div>

Oh…okay. i understand you perfectly. It will be a great one , if implimented

---

<div class="post-metadata">

**Author:** ![haroldtrk](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/haroldtrk/32/85418_2.png) [@haroldtrk](https://community.starknet.io/u/haroldtrk)\
**Post date:** [November 21, 2024, 10:51am UTC](https://community.starknet.io/t/the-great-interface-migration/92107/15 "2024-11-21T10:51:31Z")

</div>

hahah the nomenclature is very good

---

<div class="post-metadata">

**Author:** ![martriay](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/martriay/32/25_2.png) [@martriay](https://community.starknet.io/u/martriay)\
**Post date:** [November 21, 2024, 3:14pm UTC](https://community.starknet.io/t/the-great-interface-migration/92107/16 "2024-11-21T15:14:18Z")

</div>

Not entirely sure I see the value in writing a full SNIP since the migration spec is already defined above for anyone who needs it. But I can draft it out if there’s consensus on the need for formalization or even visibility.

---

<div class="post-metadata">

**Author:** ![estheroche](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/estheroche/32/85345_2.png) [@estheroche](https://community.starknet.io/u/estheroche)\
**Post date:** [November 21, 2024, 11:46pm UTC](https://community.starknet.io/t/the-great-interface-migration/92107/17 "2024-11-21T23:46:06Z")

</div>

yes , it very good indeed

---

<div class="post-metadata">

**Author:** ![glihm](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/glihm/32/73137_2.png) [@glihm](https://community.starknet.io/u/glihm)\
**Post date:** [November 27, 2024, 1:06am UTC](https://community.starknet.io/t/the-great-interface-migration/92107/18 "2024-11-27T01:06:33Z")

</div>

Let’s do that then. 👍 The idea is having something that can transition to mass adoption. Then this will also I guess impact interfaces ids for SNIP5 due to the removal of dual casing?

---

<div class="post-metadata">

**Author:** ![haroldtrk](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/haroldtrk/32/85418_2.png) [@haroldtrk](https://community.starknet.io/u/haroldtrk)\
**Post date:** [November 28, 2024, 11:32am UTC](https://community.starknet.io/t/the-great-interface-migration/92107/19 "2024-11-28T11:32:09Z")

</div>

> [@estheroche](#):
>
> yes , it very good indeed

Isn’t that a cool name?

---

<div class="post-metadata">

**Author:** ![estheroche](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/estheroche/32/85345_2.png) [@estheroche](https://community.starknet.io/u/estheroche)\
**Post date:** [November 28, 2024, 12:55pm UTC](https://community.starknet.io/t/the-great-interface-migration/92107/20 "2024-11-28T12:55:47Z")

</div>

yes , it is very cool
