starknet-docs
starknet-docs copied to clipboard
Request for Contribution: L1-L2 Messaging programming reference
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
- You can find the interfaces for these functions in IStarknetMessaging.sol
- L1 Events: IStarknetMessagingEvents.sol
- L1 Function implementations (For the implementation, you just need to provide a link to the implementation, nothing more): StarknetMessaging.sol.
Instructions for Contributing
- Leave a comment on this Issue indicating that you want to take ownership of this feature.
- Wait for our confirmation to start on the project.
- Once you have received confirmation, begin working on your contribution in a new branch.
- Create a new AsciiDoc file named
messaging_reference.adoc
incomponents/Starknet/modules/architecture_and_concepts/pages/Network_Architecture
. Use the code in the Template code section. Stick to this format. - Add the new file to the table of contents by adding an
xref
to it incomponents/Starknet/modules/architecture_and_concepts/nav.adoc
- Follow these basic writing guidelines.
- 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 I am interested in starknet, and want to take ownership of this feature. Thank you.
@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.
@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.