# smartc-signum-compiler

> C Compiler for smart contracts on Signum network

Latest version **2.3.0** (published 2024-12-11) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install smartc-signum-compiler
pnpm add smartc-signum-compiler
yarn add smartc-signum-compiler
bun add smartc-signum-compiler
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

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

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2024-12-11 |
| First published | 2022-05-15 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Rui Deleterium |
| Maintainers | deleterium |
| Keywords | smartc, compiler, blockchain, c, signum |

## Links

- npm: https://www.npmjs.com/package/smartc-signum-compiler
- Repository: https://github.com/deleterium/SmartC
- Homepage: https://github.com/deleterium/SmartC#readme
- Issues: https://github.com/deleterium/SmartC/issues
- npm.io page: https://npm.io/package/smartc-signum-compiler

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 2.3.0 (latest) — 2024-12-11
- 9999.9.6 (next) — 2024-11-03
- 9999.9.5 — 2024-02-28
- 9999.9.4 — 2024-02-21
- 9999.9.3 — 2024-02-21
- 9999.9.2 — 2024-02-18
- 2.2.1 — 2024-02-12
- 2.2.0 — 2024-02-12
- 9999.9.1 — 2024-02-12
- 9999.9.0 — 2022-08-12
- 2.1.1 — 2022-08-12
- 2.0.2 — 2022-08-06
- 2.1.0 — 2022-08-06
- 2.1.0-rc1 — 2022-08-02
- 2.0.1 — 2022-07-12
- … 15 more at https://npm.io/package/smartc-signum-compiler/versions

## README

# SmartC
> Write C smart contracts for signum network. Compile in your browser. Written in Typescript/Javascript.

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=deleterium_SmartC&metric=alert_status)](https://sonarcloud.io/dashboard?id=deleterium_SmartC)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=deleterium_SmartC&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=deleterium_SmartC)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=deleterium_SmartC&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=deleterium_SmartC)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=deleterium_SmartC&metric=coverage)](https://sonarcloud.io/dashboard?id=deleterium_SmartC)

## Objective
To empower developers, allowing them to create complex and highly optimized smart contracts.

# Setup
This library can be obtained through npm:
```
npm install smartc-signum-compiler
```

The stable version is released under tag `@latest` and the development under `@next`.

# Usage

## Web User Interface
A web user interface project is available at https://github.com/deleterium/smartc-web-ui If you want just to code with SmartC use https://deleterium.info/SmartC/

## Documentation / FAQ / Lessons
Docs files can be found in this repo, at `doc` folder.

## Node
```ts
import { SmartC } from 'smartc-signum-compiler';

//  Example: Simple compilation test
try {
    const startUpTest = new SmartC({
        language: 'C',
        sourceCode: '#pragma maxAuxVars 1\nlong a, b, c; a=b/~c;'
    })
    startUpTest.compile()
    const assemblyText = startUpTest.getAssemblyCode()
    const machineObject = startUpTest.getMachineCode()
    // Do something
} catch (e) {
    return "Compilation error: " + e.message
}
```

## Browser
Import the minified javascript file. SmartC will be imported as global.
```html
<script src="https://cdn.jsdelivr.net/npm/smartc-signum-compiler@latest/dist/smartc.min.js"></script>
```

Then in your javascript file, just use it:
```js
//  Example: Simple compilation test
try {
    const startUpTest = new SmartC({
        language: 'C',
        sourceCode: '#pragma maxAuxVars 1\nlong a, b, c; a=b/~c;'
    })
    startUpTest.compile()
    const assemblyText = startUpTest.getAssemblyCode()
    const machineObject = startUpTest.getMachineCode()
    // Do something
} catch (e) {
    return "Compilation error: " + e.message
}
```

## Changelog
Find [here](https://deleterium.github.io/SmartC/CHANGELOG) major upgrades between releases.

## Support
Did you like the project? Consider be owner of one SmartC NFT keyword. The smart contract is online at S-NFT2-6MA4-KLA2-DNM8T. More information on  [NFTv2 website](https://deleterium.info/NFTv2/). My address: S-DKVF-VE8K-KUXB-DELET.

## Social media
Join [SmartC Compiler](https://discord.gg/pQHnBRYE5c) server in Discord to stay tuned for news or ask questions.

---
_Source: https://npm.io/package/smartc-signum-compiler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
