Skip to content

Conversation

ritik4ever
Copy link

…4306
This PR adds documentation for the __state_clear intrinsic function to the compiler intrinsics reference in the Sway Book. The function was previously not documented as noted in issue #4306.

Changes Made

  • Added a detailed description of the __state_clear intrinsic function
  • Included syntax, return value, example usage, and usage notes
  • Formatted consistently with other intrinsic function documentation

Related Issue

Closes #4306

Additional Notes

I made sure to include important usage warnings since this is a function that clears all contract storage and should be used with caution.

@fuel-cla-bot
Copy link

fuel-cla-bot bot commented May 2, 2025

Thanks for the contribution! Before we can merge this, we need @ritik4ever to sign the Fuel Labs Contributor License Agreement.

@ritik4ever

This comment was marked as spam.

@ritik4ever

This comment was marked as spam.

Co-authored-by: IGI-111 <igi-111@protonmail.com>
@ritik4ever

This comment was marked as spam.

IGI-111
IGI-111 previously approved these changes May 8, 2025
@IGI-111 IGI-111 requested a review from tritao May 8, 2025 11:02
@IGI-111 IGI-111 temporarily deployed to fuel-sway-bot May 8, 2025 11:03 — with GitHub Actions Inactive
@IGI-111
Copy link
Contributor

IGI-111 commented May 8, 2025

The markdown linter is still complaining:

docs/book/src/reference/compiler_intrinsics.md:1 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "# Compiler Intrinsics"]
docs/book/src/reference/compiler_intrinsics.md:2 MD001/heading-increment/header-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]
docs/book/src/reference/compiler_intrinsics.md:2 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "### `__state_clear`"]
docs/book/src/reference/compiler_intrinsics.md:4:20 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]

@ritik4ever

This comment was marked as spam.

@ritik4ever

This comment was marked as spam.

@ritik4ever

This comment was marked as spam.

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

Successfully merging this pull request may close these issues.

__state_clear intrinsic not documented in the Sway Book
3 participants