# @replit/codemirror-lang-solidity

> Solidity language support for CM6

Latest version **6.0.2** (published 2024-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @replit/codemirror-lang-solidity
pnpm add @replit/codemirror-lang-solidity
yarn add @replit/codemirror-lang-solidity
bun add @replit/codemirror-lang-solidity
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.0.2 |
| Published | 2024-02-04 |
| First published | 2022-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 113.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Sergei Chestakov |
| Maintainers | ryanweingast, harryatreplit, theflowingsky, jonesit-replit, szymon_k, cdmistman, jackyzha0, jamesaustinreplit, lopezhoracio, jakeatreplit, bradymaddenreplit, ryantm, alexisreplit, ink404, brianpool, tobyho, brenoafb, giuseppeatreplit, masad-frost, lincolnreplit, stkenned, replitmatt, cbrewster, ltazmin_replit, moudy, schestakov, lhchavez, slmjkdbtl, lunaroyster |

## Links

- npm: https://www.npmjs.com/package/@replit/codemirror-lang-solidity
- Repository: https://github.com/replit/codemirror-lang-solidity
- Homepage: https://github.com/replit/codemirror-lang-solidity#readme
- Issues: https://github.com/replit/codemirror-lang-solidity/issues
- npm.io page: https://npm.io/package/@replit/codemirror-lang-solidity

## Dependencies (1)

- [@lezer/highlight](https://npm.io/package/@lezer/highlight.md) ^1.2.0

## Recent versions

- 6.0.2 (latest) — 2024-02-04
- 6.0.1 — 2022-11-10
- 6.0.0 — 2022-06-23
- 0.20.0 — 2022-04-22
- 0.19.0 — 2022-01-25

## README

# CodeMirror Solidity Language Support

<span><a href="https://replit.com/@util/codemirror-lang-solidity" title="Run on Replit badge"><img src="https://replit.com/badge/github/replit/codemirror-indentation-markers" alt="Run on Replit badge" /></a></span>
<span><a href="https://www.npmjs.com/package/@replit/codemirror-lang-solidity" title="NPM version badge"><img src="https://img.shields.io/npm/v/@replit/codemirror-lang-solidity?color=blue" alt="NPM version badge" /></a></span>

A CodeMirror extension that provides Solidity syntax highlighting and language support.

![Screenshot](public/cm-solidity-support.png)

### Usage

```ts
import { basicSetup } from 'codemirror';
import { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { solidity } from '@replit/codemirror-lang-solidity';

const doc = `
pragma solidity ^0.8.10;

contract EtherWallet {
    address payable public owner;

    constructor() {
        owner = payable(msg.sender);
    }

    receive() external payable {}

    function withdraw(uint _amount) external {
        require(msg.sender == owner, "caller is not owner");
        payable(msg.sender).transfer(_amount);
    }

    function getBalance() external view returns (uint) {
        return address(this).balance;
    }
}
`

new EditorView({
  state: EditorState.create({
    doc,
    extensions: [
      basicSetup,
      solidity,
    ],
  }),
  parent: document.querySelector('#editor'),
});
```

---
_Source: https://npm.io/package/@replit/codemirror-lang-solidity · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
