# smartweave

> Simple, scalable smart contracts on the Arweave protocol.

Latest version **0.4.49** (published 2022-06-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install smartweave
pnpm add smartweave
yarn add smartweave
bun add smartweave
```

Provides the commands `smartweave`, `smartweave-cli`.

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.49 |
| Published | 2022-06-02 |
| First published | 2020-09-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 13 |
| Unpacked size | 114.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 256 |
| Maintainers | hlolli, rosmcmahon, cedriking, luca-arweave |

## Links

- npm: https://www.npmjs.com/package/smartweave
- Repository: https://github.com/ArweaveTeam/SmartWeave
- Homepage: https://github.com/ArweaveTeam/SmartWeave#readme
- Issues: https://github.com/ArweaveTeam/SmartWeave/issues
- npm.io page: https://npm.io/package/smartweave

## Dependencies (13)

- [clui](https://npm.io/package/clui.md) ^0.3.6
- [chalk](https://npm.io/package/chalk.md) ^4.x
- [yargs](https://npm.io/package/yargs.md) ^17.5.1
- [figlet](https://npm.io/package/figlet.md) ^1.5.2
- [arweave](https://npm.io/package/arweave.md) ^1.11.4
- [inquirer](https://npm.io/package/inquirer.md) ^8.2.4
- [loglevel](https://npm.io/package/loglevel.md) ^1.8.0
- [sentencer](https://npm.io/package/sentencer.md) ^0.2.1
- [@types/clui](https://npm.io/package/@types/clui.md) ^0.3.1
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.0.2
- [json-beautify](https://npm.io/package/json-beautify.md) ^1.1.1
- [@types/inquirer](https://npm.io/package/@types/inquirer.md) ^8.2.1
- [@weavery/clarity](https://npm.io/package/@weavery/clarity.md) ^0.1.5

## Recent versions

- 0.4.49 (latest) — 2022-06-02
- 0.4.48 — 2022-04-05
- 0.4.46 — 2021-10-25
- 0.4.45 — 2021-09-09
- 0.4.44 — 2021-09-03
- 0.4.43 — 2021-08-25
- 0.4.42 — 2021-08-24
- 0.4.41 — 2021-07-29
- 0.4.40 — 2021-07-29
- 0.4.39 — 2021-07-16
- 0.4.38 — 2021-07-02
- 0.4.37 — 2021-07-02
- 0.4.36 — 2021-07-02
- 0.4.35 — 2021-07-02
- 0.4.34 — 2021-07-01
- … 35 more at https://npm.io/package/smartweave/versions

## README

# SmartWeave

[![Gitopia](https://img.shields.io/endpoint?style=&url=https://gitopia.org/mirror-badge.json)](https://gitopia.org/#/BPr7vrFduuQqqVMu_tftxsScTKUq9ke0rx4q5C9ieQU/smartweave)

## Simple, scalable smart contracts on the Arweave protocol

Uses lazy-evaluation to move the burden of contract execution from network nodes
to smart contract users. Currently, SmartWeave supports JavaScript, using the
client's unmodified execution engine.

**Version: 0.4**

For information on how the contracts execute, how to write one, and the API, read the [Contract Guide](CONTRACT-GUIDE.md) and check some of the [examples](examples/)

For information on how to create a new Profit Sharing Token (PST), you can read the [PST Creation Guide](CREATE-PST.md).

For a description of the SDK methods available, you can check [here](SDK.md)

## CLI Usage

`npm install -g smartweave`

You can deploy a contract as follows:

```
smartweave create [SRC LOCATION] [INITIAL STATE FILE] --key-file [YOUR KEYFILE]
```

Or, using an existing contract source that is already deployed but with a new initial state and contract id:

```
smartweave [SRC TX] [INITIAL STATE FILE] --key-file [YOUR KEYFILE]
```

Check its state:

```
smartweave read [CONTRACT TXID]
```

Interact with it:

```
smartweave write [CONTRACT TXID] --key-file [YOUR KEYFILE] \
  --input "[CONTRACT INPUT STRING HERE]"
```

When interacting with the contract, the value passed to --input must be valid json. Typically an object is used:

`--input '{ "function": "transfer", "qty": 1984 }'`

To test a contract interaction without writing it to the network, append `--dry-run` to your `--interact` call.

## License

This project is licensed under the terms of the MIT license.

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