starknet-io / starknet-docs

The repo for Starknet's developer documentation. Includes contribution guidelines and the Starknet documentation supplementary style guide
https://docs.starknet.io/
112 stars 159 forks source link

Improve documentation on `LegacyBridge.sol` and the new `StarknetTokenBridge.sol` & `token_bridge.cairo` #1201

Open 9oelM opened 3 months ago

9oelM commented 3 months ago

Is your feature request related to a problem? Please describe. When it comes to token transfers across L1 and L2, there are three contracts we need to look at:

Altogether, the newer version of the bridges at L1 and L2 are called 'MultiBridge', because it supports bridging multiple tokens unlike LegacyBridge.

However, the current documentation about using L1↔L2 bridge is rather a bit confusing.

To start with, some parts of the current documentation about Starkgate bridge is primarily focused on using LegacyBridge only. For example, under L2 function reference, there is only initiate_withdraw which is meant to be used by LegacyBridge, and there is no initiate_token_withdraw which is meant to be used by MultiBridge.

On the other hand, some references in the documentation seem to be well up-to-date, which is also problematic because the documentation about the existing LegacyBridge functions seems to have vanished. LegacyBridge is still very much in use by ETH and other prominent tokens, so the documentation on this should not go away. For example, L1 function signature of withdraw is only for the newest StarknetTokenBridge which is withdraw(address token, uint256 amount, address recipient). But still there are tokens that are using LegacyBridge in production, which has withdraw(uint256 amount, address recipient).

Describe the solution you'd like

There are other bits and pieces that don't quite make sense in a similar sense which seem to need a bit of improvement. Overall, the documentation should make a clear distinction between LegacyBridge and MultiBridge and how to use either of them.

stoobie commented 3 months ago

@9oelM Thanks for the great comments and ideas! Since you seem to have a good understanding of this, are you interested in creating a PR?

9oelM commented 3 months ago

@9oelM Thanks for the great comments and ideas! Since you seem to have a good understanding of this, are you interested in creating a PR?

Happy to help. Will do

stoobie commented 3 months ago

@9oelM Please make sure you scan over the documentation guidelines and the style guidelines mentioned on the home page of the repo. It'll save me a lot of time if you keep those in mind. In particular, please stay away from the passive voice as much as possible. That is, if you can phrase something in the active voice, please do.

There are other important guidelines as well, but I find that the passive voice is the one that I spend the most time correcting..

9oelM commented 3 months ago

@9oelM Please make sure you scan over the documentation guidelines and the style guidelines mentioned on the home page of the repo. It'll save me a lot of time if you keep those in mind. In particular, please stay away from the passive voice as much as possible. That is, if you can phrase something in the active voice, please do.

There are other important guidelines as well, but I find that the passive voice is the one that I spend the most time correcting..

Sure will do, thanks for the guidance. Will probs work on it during this week

stoobie commented 2 months ago

@9oelM Do you think that you'll submit a PR in the near future? I'd like to provide a reward via OnlyDust.xyz, but I can't promise how much without seeing your PR.

Also we have a Telegram channel now that you can join.

9oelM commented 2 months ago

Hey @stoobie thanks for the comment. Sorry about the delay. I was actually working on an extensive overview of Starknet messaging/bridging which is now published at https://research.lazer1.xyz/blog/making-sense-of-starknet-architecture-and-l1-l2-messaging/#l1-l2-messaging because I felt like an explanation of inner workings of the bridge is necessary in order to understand how different pieces come together at the end user level.

So I was wondering if there is any way to incorporate the important/good parts from my writing into the official docs.

I have joined the tg group, let's talk more there!

cybermazi commented 1 month ago

Hello. Is this PR still open @9oelM @stoobie .

Can you please update the documentation issues