starknet-docs icon indicating copy to clipboard operation
starknet-docs copied to clipboard

Request for Contribution: L1-L2 Messaging programming reference

Open stoobie opened this issue 1 year ago • 3 comments

Please reply in the comments if you are interested.

Description

Document the L1 functions and L1 events that enable L1->L2 messaging. Include general descriptions of the contracts that include the functions. For example, see the StarkGate function and event reference

For each function, include the following information:

  • <function name>
  • Description: An in-depth description of the function that includes:
    • What does the function do?
    • Why does it matter?
    • Any other information that is necessary or useful to know.
  • State mutability: Pure/payable/non-payable/view
  • Parameters: For each parameter: :: <Description>. If there are no parameters, specify None.
  • Return values: Same as Parameters. If there are no return values, specify None.
  • Function definitions: Links to the function interfaces within the contract, and to the function implementations.

Examples: deposit, getStatus, and others in the StarkGate function and event reference.

For each event, include the following information:

  • <event name>
  • Description:
    • What does the function do?
    • Why does it matter?
    • Any other information that is necessary or useful to know.
  • Event attributes: List attributes of the event.

Examples: See Emitted event and Event attributes in depositCancelRequest, withdraw, and others in the StarkGate function and event reference.

NOTE: In these examples, the events are directly tied to the relevant functions. For the Messaging event reference, the events should have their own dedicated section.

Source material

Instructions for Contributing

  1. Leave a comment on this Issue indicating that you want to take ownership of this feature.
  2. Wait for our confirmation to start on the project.
  3. Once you have received confirmation, begin working on your contribution in a new branch.
  4. Create a new AsciiDoc file named messaging_reference.adoc in components/Starknet/modules/architecture_and_concepts/pages/Network_Architecture. Use the code in the Template code section. Stick to this format.
  5. Add the new file to the table of contents by adding an xref to it in components/Starknet/modules/architecture_and_concepts/nav.adoc
  6. Follow these basic writing guidelines.
  7. Be ready to make changes based on review comments.

AsciiDoc Function Template

[id=”messaging_reference”]
= Messaging reference

== L1 Function reference
'''

[#function_name]
=== `<function_name>`

[discrete]
==== Description

<Add text for description here>

[discrete]
==== State Mutability

`payable` | `non-payable` | `view` | `pure`

[discrete]
==== Parameters

[horizontal,labelwidth="30",role=stripes-odd]
`<type> _<param_name>_`:: <Description>

[discrete]
==== Returns

This section should include a list of return values and what they mean in the same format as Parameters:

[horizontal,labelwidth="30",role=stripes-odd]
`<type> _<return_value>_`:: <Description>


[discrete]
==== Function definitions

Contract: link:<URL>[`<filename>.sol`]

* Function: link:<URL_permalink>[`<function_name>`]

AsciiDoc Event Template

Add this below all functions

== L1 Event reference

Add link to contract here.

[#event_name]
=== `<event_name>`

[discrete]
==== Description

<Add text for description here, including what triggers this event.>

[discrete]
==== Event attributes

[horizontal,role=stripes-odd]
`<type> _<attribute_name>_`:: <Description>.

[discrete]
==== Event definition

* Contract: link:<URL_of_contract>[`<contract_name>`]

* Event: link:<permalink_to_event>[`<event_name>`]

Remuneration

Compensation for the approved contribution will be provided via OnlyDust.

Deadline

Maximum of 10 days per example

Contact

If you have any questions or need further details, please contact @stoobie.


We look forward to your proposals. Thank you for contributing to the Starknet ecosystem!

stoobie avatar Jan 17 '24 11:01 stoobie

@stoobie I am interested in starknet, and want to take ownership of this feature. Thank you.

xiaolou86 avatar Jan 22 '24 06:01 xiaolou86

@xiaolou86 Thank you for volunteering! It's yours. Go ahead and begin. Please make sure you read all the guidelines above and see the examples that I linked to.

Let me know if you have any questions.

stoobie avatar Jan 22 '24 07:01 stoobie

@xiaolou86 Thank you for volunteering! It's yours. Go ahead and begin. Please make sure you read all the guidelines above and see the examples that I linked to.

Let me know if you have any questions.

Got it.

xiaolou86 avatar Jan 22 '24 08:01 xiaolou86