Skip to content

docs: align README shielded examples with current compiler behavior #399

Description

@Osraka

The main README currently contains two behavior mismatches with the compiler on the current seismic branch (e0eb91ec8).

First, the ConfidentialWallet usage example does not compile with:

ssolc --evm-version mercury --bin ConfidentialWallet.sol

The compiler reports:

  • a public function returning suint256;
  • an address == saddress comparison;
  • contract instantiation from an saddress;
  • a call to the private addFunds function through another contract instance.

Second, the mappings section says that shielded types are supported for keys and/or values. The compiler rejects a shielded key with Shielded types are not allowed as mapping keys, while a public key with a shielded value compiles. The README's error-code table already describes shielded mapping keys as disallowed.

This is more than a wording cleanup: the primary example teaches APIs that current users cannot compile. The repository already has a test/libsolidity/syntaxTests/docExamples/ pattern for keeping documentation examples checked by the compiler.

Would the preferred scope be a single PR that:

  1. replaces the wallet example with a currently supported, compilable example;
  2. documents that mapping values may be shielded but keys may not; and
  3. adds a focused syntax test for the README example to prevent future drift?

I can prepare that as a documentation-and-test-only change, without touching compiler behavior.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions