Code Monkey home page Code Monkey logo

starknet-docs's People

Contributors

0xx92 avatar anshulforyou avatar antiyro avatar arielelp avatar bigant88 avatar carmitkl avatar dan-ziv avatar emnul avatar glihm avatar glrn avatar guyvelleman avatar hardiktheprogrammer avatar idan-starkware avatar jamestark avatar jogetblock avatar kmjones1979 avatar landauraz avatar lorcan-codes avatar lucaslvy avatar mirko-von-leipzig avatar natan-granit avatar nikeshnazareth avatar odednaor avatar robertkodra avatar roi-amaler-starkware avatar sselmann avatar stoobie avatar tdelabro avatar wojciechos avatar xiaolou86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

starknet-docs's Issues

Wrong order of parameters in deploy_account_tx_hash

Feature Request : Add FAQ

Is your feature request related to a problem? Please describe.
Add FAQ

Questions to address in FAQ

  • Why was an alpha version released instead of directly launching the production version (referring to Starknet)?
  • What is the expected TPS in the future production version, or what is the estimated maximum TPS for the L2 developed by STARKs?
  • Why is the actual transaction completion time different from the estimated transaction time within the explorer?
  • Is it necessary to wait for the status to become 'accepted on L1' for a transaction to be considered complete?
  • Is it possible to manually increase gas fees to speed up transactions?
  • Why does it take so long for withdrawals using Starkgate to be credited, and why is an Ethereum gas fee still required?

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

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.

*Seeking Contribution* PRs from forks are not generating preview builds.

Describe the bug

When a PR originates from a forked repo, it does not generate an HTML preview to enable reviewing and testing the PR in a browser prior to merging.

The issue becomes visible when the runner runs the Commit changes step in the pull_requent.yml workflow.

To Reproduce
Steps to reproduce the behavior:

  1. Fork (and optionally clone) the starknet-docs repo.
  2. Create a new branch and make a small change in an .adoc file.
  3. Push the new branch and create a new PR.

Expected behavior
You should see this in Conversaton tab of the PR
image

You should also see a link like this one (with the correct PR-number):
image

Feature Request: Add Link of OKLink Block Explorer

Is your feature request related to a problem? Please describe.
Currently, the absence of OKLink Block Explorer Add link our ability to access comprehensive blockchain data, which could enhance our user experience.
Describe the solution you'd like
I would like to request the Add link of OKLink Block Explorer as a feature. This addition would provide users with a powerful tool to explore and analyze blockchain data seamlessly within our platform.

Additional context

Screenshot (330)

Correct the deploy account page and provide more ways to deploy accounts using UDC

In the deploying new accounts page: https://docs.starknet.io/documentation/architecture_and_concepts/Accounts/deploying_new_accounts/#validate_deploy

When using the deploy_account transaction, the deployed contract must have a __validate_deploy__ entrypoint. Currently this is mentioned as optional.

One can also deploy an account using the deploy syscall. There is a convenient option to use this syscall using the Universal Deployer Contract (UDC) by OpenZeppelin.

starkli account fetch command unexpected argument error

was following the Starknet developer documentation and encountered an issue while trying to use the starkli account fetch command. The documentation suggests the following command:

bash
Copy code
starkli account fetch 0x0--------C--F2 ~/starkli-wallets/deployer/account.json
However, when I tried to execute this command, I received the following error:

vbnet
Copy code
error: unexpected argument '/Users/xxxx/starkli-wallets/deployer/account.json' found

Usage: starkli account fetch [OPTIONS]


Expected Behavior:

I expected the starkli account fetch command to execute without errors, as per the documentation.

Actual Behavior:

The command results in an unexpected argument error.

Steps to Reproduce:

Execute the following command as per the documentation:
bash
Copy code
starkli account fetch 0x0--------C--F2 ~/starkli-wallets/deployer/account.json
Additional Information:

Operating System: [Your OS]
Starknet Version: [Version, if applicable]
Any other relevant information.
Please advise on the correct usage of the starkli account fetch command or update the documentation to reflect the correct usage.

Broken Link

Describe the bug
Encountered a broken or invalid link in the Starknet Docs repository. The link to the Starknet Docs team appears to be dysfunctional,
starknet doc Team

Explicitly state that failing `call_contract_syscall` can't be caught and will revert the entire tx

Is your feature request related to a problem? Please describe.

It's not written anywhere (is it?) that, quoting Ariel,

an internal call can't return Err(_), as this is not handled by the sequencer and the Starknet OS.

I think it's very important to have it as a warning in the documentation, as it's a pattern that already a lot of developers assume is correct - but once deployed, it will lead to incorrect results

Describe the solution you'd like
A warning here about this specific case

Describe alternatives you've considered

Additional context

Add the Cairo corelib repo URL to the list of important addresses

From a user:

I can't find a repo containing the core contracts from Starknet, though I have a vague memory of it existing. Can we get a repo of them linked on the Important addresses topic or somewhere relevant?

Here's the directory with the Corelib source files:
https://github.com/starkware-libs/cairo/blob/v2.6.0/corelib/src/

Here's the main corelib file:
https://github.com/starkware-libs/cairo/blob/v2.6.0/corelib/src/starknet/info.cairo

*Seeking Contribution* Add list of contributors

Add a list of contributors. Ideally, this would be automatically updated. If you know how to do this, such a contribution would be very much appreciated!

Ideally, you should be able to see a list of contributors on each published page, like the See contributors button in the developer documentation on Ethereum.org:
image

TIP
From @omahs:

For the Contributors list, this tool is used on many repos: https://allcontributors.org/

This contribution is eligible for funding via OnlyDust. If you are interested in taking on this PR, please leave a comment to let me know.

Test

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

How to regain the trust of the community

Is your feature request related to a problem? Please describe.
If you've been on CT since the airdrop you have seen the constant FUD that is staining the starknet name which clearly is on a downward spiral. We must prioritize community it has become abundantly clear that without community in web3 projects will always fail. Consider Starknet is the most technological advanced chain in web3 so how come people arent using it? Quite simple the community felt betrayed after the first airdrop which caused a feedback loop and now any tweet even mentioning starknet gets witch hunted.

Describe the solution you'd like
The first priority needs to be how can we earn the communities trust back? This may seem like the most difficult step and it is, however once trust is reestablished the rest will all come together. As stated before Stark has the best tech of all the chains , people want to use it but they will likely never use it if the first airdrop is not fixed. Regardless of future airdrop rounds in the future this is not enough incentive for someone to return to a chain whom they believe betrayed them. My solution , reward users who were only not eligible due to the lack of .005 eth (the amount of $strk here does not matter) people will return to the chain as long as they feel they were not betrayed and the team is taking some steps to remedy the situation.

Describe alternatives you've considered
alternative solutions will be difficult because as long as the people from the first round are not rewarded with something, the stain on Starknet will remain. W e can assume most who were not eligible due to the .005 eth criteria are not plenty and then the others who were not eligible regardless of the .005 eth criteria. Secondary solution reward the users who would have been eligible if not for the .005 eth with the unclaimed $STRK tokens from the first airdrop.

Additional context
I have been in web3 for a long time and i know how this story ends, without community it is nearly impossible to succeed. Seeing a chain with superior tech like Starknet getting railroaded because of a minor mistake is a tough pill to swallow but by no means is it not fixable.

REGAIN COMMUNITY TRUST

Discussed in #1256

Originally posted by maallam24 May 11, 2024
-Is your feature request related to a problem? Please describe.

If you've been on CT since the airdrop you have seen the constant FUD that is staining the starknet name which clearly is on a downward spiral. We must prioritize community it has become abundantly clear that without community in web3 projects will always fail. Consider Starknet is the most technological advanced chain in web3 so how come people arent using it? Quite simple the community felt betrayed after the first airdrop which caused a feedback loop and now any tweet even mentioning starknet gets witch hunted.

-Describe the solution you'd like

The first priority needs to be how can we earn the communities trust back? This may seem like the most difficult step and it is, however once trust is reestablished the rest will all come together. As stated before Stark has the best tech of all the chains , people want to use it but they will likely never use it if the first airdrop is not fixed. Regardless of future airdrop rounds in the future this is not enough incentive for someone to return to a chain whom they believe betrayed them. My solution , reward users who were only not eligible due to the lack of .005 eth (the amount of $strk here does not matter) people will return to the chain as long as they feel they were not betrayed and the team is taking some steps to remedy the situation.

-Describe alternatives you've considered

alternative solutions will be difficult because as long as the people from the first round are not rewarded with something, the stain on Starknet will remain. W e can assume most who were not eligible due to the .005 eth criteria are not plenty and then the others who were not eligible regardless of the .005 eth criteria. Secondary solution reward the users who would have been eligible if not for the .005 eth with the unclaimed $STRK tokens from the first airdrop.

-Additional context

I have been in web3 for a long time and i know how this story ends, without community it is nearly impossible to succeed. Seeing a chain with superior tech like Starknet getting railroaded because of a minor mistake is a tough pill to swallow but by no means is it not fixable.</div>

Migration guide: code for event emission doesn't compile

I followed the steps in the migration guide and arrived at this complete source file:

#[starknet::interface]
trait ICounterContract<TContractState> {
   fn increase_counter(ref self: TContractState, amount: u128);
   fn decrease_counter(ref self: TContractState, amount: u128);
   fn get_counter(self: @TContractState) -> u128;
}

#[starknet::contract]
mod CounterContract {
    #[storage]
    struct Storage {
        counter: u128
    }

    #[event]
    #[derive(Drop, starknet::Event)]
    enum Event {
        CounterIncreased: CounterIncreased,
        CounterDecreased: CounterDecreased
    }

    #[derive(Drop, starknet::Event)]
    struct CounterIncreased {
        amount: u128
    }

    #[derive(Drop, starknet::Event)]
    struct CounterDecreased {
        amount: u128
    }

    #[external(v0)]
    impl CounterContract of super::ICounterContract<ContractState> {
        fn increase_counter(ref self: ContractState, amount: u128) {
            self.emit(CounterIncreased { amount });
        }

        fn decrease_counter(ref self: ContractState, amount: u128) {
        }

        fn get_counter(self: @ContractState) -> u128 {
            self.counter.read()
        }
    }
}

But the emission of the event doesn't compile:

➜  cairo_practice starknet-compile counter.cairo counter.json
error: Trait has no implementation in context: core::starknet::event::EventEmitter::<counter::counter::CounterContract::ContractState, counter::counter::CounterContract::CounterIncreased>
 --> counter.cairo:35:18
            self.emit(CounterIncreased { amount });
                 ^**^

Error: Compilation failed.

Here's my starknet-compile version:

starknet-compile 2.0.0-rc2

Add overview of all smart contracts involved and their users

Not sure where to ask/ request it, so I do it here.

I want to assess all smart contracts involved to make Starknet work, be it on L1 or Starknet.
This would include which users/ addresses have which rights.

Example contracts: STRK token contract on Ethereum, Starknet core contract, StarkGate, ...

I'd assume some external party did a review of them? Are these accessible to the public? The review would probably state such an overview.

Thanks a lot!

Request for Contribution: Describe Cairo builtins

Description

We need a page that describes what Cairo builtins are, what they do generally, and a list of builtins with a short description of what each one does specifically.

Explain what high-level Cairo code ends up invoking a given builtin? For example:

  • a&b is a single application of the bitwise builtin.
  • a>b is a rangecheck.

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 builtins.adoc in components/Starknet/modules/architecture_and_concepts/pages/Smart_Contracts.
  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. IMPORTANT: Do not simply copy and paste existing text in the source material above. Follow these basic writing guidelines. Some basic guidelines include: Use the active voice, not the passive voice, talk to your reader directly by using the second-person (you) and imperative. Use the present tense, avoid the future tense.
  7. Be ready to make changes based on review comments.

Remuneration

Compensation for the approved contributions will be provided via OnlyDust.

Deadline

Maximum of 10 days

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!

Feature Request : Add more to FAQ

Would be highly appreciated to add more info regarding the fees that go to the Sequencer, rebates and burning mechanism.

  1. What does the Sequencer do with the gas fees? (ETH or STRK)
    Wasn't able to answer it reading https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/fee-mechanism/. I believe that the Sequencer would use the tokens to cover the costs for it to be 'pushed' to Ethereum. But with v0.13.0, STRK tokens can be used, so are these atomically converted to ETH?
  2. How exactly are rebates used for?
    I found this https://medium.com/starkware/part-3-starknet-token-design-5cc17af066c6. However, are this meant to cover the airdrop claims? Thus, these will be swapped to ETH?
  3. Is there any burning mechanism?
    I believe just for withdrawing from L2->L1, right?

Thanks a lot and apologies if these were answered before. Didn't find them in the docs.

Installation instructions are incomplete in readme.md

Add the following to README.MD

Prerequisites

*Seeking Contribution* Proof of concept: Convert .md to .adoc

Is your feature request related to a problem? Please describe.

The Starknet docs are authored in AsciiDoc, and use Antora to generate the site on docs.starknet.io.

AsciiDoc syntax is similar to Markdown, and as simple as Markdown to get started, but it has a small learning curve for many similar features. For example, headings, italics, links, and source code formatting differ from Markdown syntactically.

Potentially, Markdown-savvy contributors without experience writing in AsciiDoc might be intimidated by AsciiDoc, in spite of its simplicity and similarity to Markdown.

For many features, AsciiDoc is forgiving of Markdown syntax, but not for all. The syntax you must change is listed in the table under the Comparison by example section in the Asciidoctor documentation.

Describe the solution you'd like
You can use Kramdown AsciiDoc to automate the migration from Markdown to AsciiDoc.

One potential solution: The pull_request.yml file, or some other Github workflow, has a step that receives a markdown (.md) file when saved to a modules/<module_name>/pages subdirectory, runs kramdown, which converts the markdown file to AsciiDoc, and adds it to the nav.adoc in modules/<module_name>/nav.adoc.

Before implementing a workflow, someone needs to test Kramdown, preferably with a few relatively complex Markdown files from the Starknet Book or the Cairo Book.

Describe alternatives you've considered

The best long-term solution is for contributors to learn the correct syntax and author files directly in AsciiDoc. In case learning independently is too intimidating, then 1 or 2 community calls can provide the necessary training.

Docs links throw 404 in certain scenarios

Describe the bug
Docs links throw 404 in certain scenarios, explained in steps to reproduce

To Reproduce

  1. For example open this page:
    https://docs.starknet.io/docs/Blocks/transactions#chain-id
  2. If you refresh the page, the link changes to:
    https://docs.starknet.io/docs/Blocks/transactions/#chain-id
    (notice the slash before #chain-id)
  3. after that other links don't work also, because link for pedersen hash becomes:
    https://docs.starknet.io/docs/Blocks/Hashing/hash-functions#pedersen-hash
    instead of:
    https://docs.starknet.io/docs/Hashing/hash-functions#pedersen-hash

Expected behavior
Links should work in all scenarios

Screenshots

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Edge 102.0.1245.33 and Firefox 101

Function name heading should clearly delineate section

This is how the functions are displayed currently in the StarkGate function reference:
Screenshot 2023-10-24 at 17 07 41

It's kinda hard to see that we are in another function because everything is in the same color and there's no clear separation. I think that the function names (which are titles) in this page should be easily identifiable either by using another color or something else.

Feature Request: Privacy Page and Security Enhancement

Is your feature request related to a problem? Please describe.

In order to fortify our system against potential vulnerabilities and ensure a robust security framework, it is imperative to introduce comprehensive security measures.

Describe the solution you'd like

I propose the addition of a dedicated security section, encompassing both auditing processes and the establishment of a bug bounty program. This will not only identify and rectify potential vulnerabilities but also incentivize the community to actively contribute to the starknet security.

Describe alternatives you've considered

Additional context

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: :: . 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!

command not found: starknet

Describe the bug
I follow instruction of quick start at starknet new_account --account <account_name> get this error:
command not found: starknet

To Reproduce
Follow quick start instruction at here https://docs.starknet.io/documentation/quick_start/environment_setup/

Expected behavior
It should be successful

Screenshots

Desktop (please complete the following information):

  • OS: macOS
    starkli --version : 0.1.13 (305a9b1)

It's really bad for official website's quick start has such obvious mistake, previously steps even not mention a word about starknet.

*Seeking Contribution* [FIX] Generate previews from forked repos. This currently doesn't work.

Background

When you create or update a PR, a preview of the site is generated with your changes and deployed to the gh-pages branch in a directory named after the PR ID.

Problem

The Github flow deploy-review in /.github/workflows/pull_request.yml does not successfully deploy the generated site preview to the gh-pages branch for contributions originating from forks. The issue becomes visible when the runner runs the Commit changes step in the pull_requent.yml workflow.

To Reproduce

Steps to reproduce the behavior:

  1. Fork (and optionally clone) the starknet-docs repo.
  2. Create a new branch and make a small change in an .adoc file.
  3. Push the new branch and create a new PR.

Expected behavior

You should see this in Conversation tab of the PR
image

You should also see a link like this one (with the correct PR-number):
image

Contract storage page is still referring to the old cairo syntax

Describe the bug
Smart contract storage page is still using outdated cairo syntax and decorators.
(Not sure if it can be considered as a bug or a feature, I do apologize if bug is not appropriate).

To Reproduce

  1. Go to storage page.

Expected behavior
Updated content for the new syntax.

Desktop (please complete the following information):
Any version.

Additional context
I would love to try submitting a PR to edit this content if you agree.

Style guide: Make guideline for referring to consecutive items, such as state

Example:

A transaction 𝑡𝑥 transitions the system from state 𝑆 to state 𝑆′ if:

Let's define a guideline that uses subscript with numbers, so the above should be:

A transaction 𝑡𝑥 transitions the system from state 𝑆_0 to state 𝑆_1 if:

The underscore indicates subscript. Not sure how to do it in MD.

The MathJax data formula style is disordered, with overlapping content

Describe the bug
The MathJax data formula style is disordered, with overlapping content.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/transactions/#v3_hash_calculation
  2. scroll a little to the data_availability_modes description

Expected behavior
tidy formula style

Screenshots
If applicable, add screenshots to help explain your problem.
Snipaste_2024-02-24_00-05-19

Desktop (please complete the following information):

  • OS: macOS 14.3.1 (23D60)
  • Browser chrome
  • Version 121.0.6167.184(正式版本) (arm64)

Additional context
Add any other context about the problem here.

Request for Contribution: Add a page explaining the Compiled class hash

Please reply in the comments if you are interested.

Description

The Starknet docs explains the Class hash, but not the Compiled class hash. We need a similar page for the Compiled class hash that describes:

  • What it is, why it exists
  • Which entities use it, in what context
  • Make sure to state that you need to generate it somehow, such as with an SDK, before you can send a DECLARE transaction.
  • How an SDK and the sequencer calculate the compiled class hash, pseudo code is fine, as in Computing the Cairo class hash.
  • Use the information in the Note in commit bc419f6 at line 107.

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 compiled_class_hash.adoc in components/Starknet/modules/architecture_and_concepts/pages/Smart_Contracts.
  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.

Remuneration

Compensation for the approved contributions will be provided via OnlyDust.

Deadline

Maximum of 10 days

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!

Migration guide: code for event emission doesn't compile

I followed the steps in the migration guide and arrived at this complete source file:

#[starknet::interface]
trait ICounterContract<TContractState> {
   fn increase_counter(ref self: TContractState, amount: u128);
   fn decrease_counter(ref self: TContractState, amount: u128);
   fn get_counter(self: @TContractState) -> u128;
}

#[starknet::contract]
mod CounterContract {
    #[storage]
    struct Storage {
        counter: u128
    }

    #[event]
    #[derive(Drop, starknet::Event)]
    enum Event {
        CounterIncreased: CounterIncreased,
        CounterDecreased: CounterDecreased
    }

    #[derive(Drop, starknet::Event)]
    struct CounterIncreased {
        amount: u128
    }

    #[derive(Drop, starknet::Event)]
    struct CounterDecreased {
        amount: u128
    }

    #[external(v0)]
    impl CounterContract of super::ICounterContract<ContractState> {
        fn increase_counter(ref self: ContractState, amount: u128) {
            self.emit(CounterIncreased { amount });
        }

        fn decrease_counter(ref self: ContractState, amount: u128) {
        }

        fn get_counter(self: @ContractState) -> u128 {
            self.counter.read()
        }
    }
}

But the emission of the event doesn't compile:

➜  cairo_practice starknet-compile counter.cairo counter.json
error: Trait has no implementation in context: core::starknet::event::EventEmitter::<counter::counter::CounterContract::ContractState, counter::counter::CounterContract::CounterIncreased>
 --> counter.cairo:35:18
            self.emit(CounterIncreased { amount });
                 ^**^

Error: Compilation failed.

Here's my starknet-compile version:

starknet-compile 2.0.0-rc2

feat: Reorganize and add info to Devtools page

This item is to update the text and diagram on https://docs.starknet.io/documentation/tools/devtools/.

Add table/mini-toc to the beginning of topic with sections according to the categories in the diagram, as outlined below. The existing mini-toc, which appears on the right of the body pane on a desktop browser window, is according to tool name, not type of tool.

Suggested Outline (According to categories in diagram):

  • Basic interaction with CLI, query-bolding tool (@amanusk please add the name of the tool here)
    • Starkli (also refer to Foundry Cast, but put the info under Developing smart contracts)
  • Programming with SDKs and libraries
    • starknet.js
    • starknet.py
    • starknet-rs
    • starknet-go
    • starknet-React (New) @amanusk
    • get-starknet (New) @amanusk
  • Developing smart contracts
    • Scarb
    • Starknet Foundry
    • Starknet Remix plugin (In the diagram, remove "Cairo plug-in)
    • Cairo language server (VS Code plugin)
    • Hardhat + Starknet (Maintenance mode only)
    • Cairo profiler (new @amanusk)
  • Local devnet
    • starknet-devnet-rs
    • Katana
  • Security tools (@amanusk Please add info)
  • Bonus
    • ABI decoder
    • Universal Sierra compiler
    • @amanusk What else?

In addition, move Who maintains it to the end of each section.

Taking

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Add nonce definition to the docs

The nonce of an address is the number of transactions originating from this address + 1. For example, the starknet_getNonce request of an account that was deployed (with nonce 0 in the deploy tx) but that did not send any transactions, should be 1.

feat: add `l1_handler_transaction` version table

Is your feature request related to a problem? Please describe.
Currently, we have a table for transaction version, but l1_hander_transaction is not in this table. This is important to have in order to compute the transaction hash.

Describe the solution you'd like
Add l1_handler_transaction version (which is 0 currently) to the transaction table in the page Transaction Types. Or a new table in the L1-L2 Messaging page where the computation of l1_handler_transaction actually is.

I would be happy to open a PR if this suggestion is approved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.