# @hashflow/hashverse-contracts

> Smart Contracts to power the HashVerse.

Latest version **1.3.1** (published 2023-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hashflow/hashverse-contracts
pnpm add @hashflow/hashverse-contracts
yarn add @hashflow/hashverse-contracts
bun add @hashflow/hashverse-contracts
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2023-05-15 |
| First published | 2022-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 151.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Victor Ionescu |
| Maintainers | michael-hashflow, btraut, gxmxni, gandalfthebrown |

## Links

- npm: https://www.npmjs.com/package/@hashflow/hashverse-contracts
- Repository: https://github.com/hashflownetwork/hashverse-contracts
- Homepage: https://github.com/hashflownetwork/hashverse-contracts#readme
- Issues: https://github.com/hashflownetwork/hashverse-contracts/issues
- npm.io page: https://npm.io/package/@hashflow/hashverse-contracts

## Recent versions

- 1.3.1 (latest) — 2023-05-15
- 1.3.0 — 2023-04-05
- 1.2.0 — 2023-04-02
- 1.0.2 — 2023-01-11
- 1.0.1 — 2023-01-11
- 1.0.0 — 2023-01-11
- 0.0.1 — 2022-12-21

## README

# Running Tests

## Unit Tests

1. Run `yarn` to install all dependencies.
2. [Optional] Run `yarn hardhat compile` to ensure that contracts compile.
3. Run `yarn hardhat test`.

## Wormhole Integration Tests

In order to test the x-chain capabilities of the Avatar and Item contracts, we need
to run integration tests that simulate Wormhole message relays.

1. Run `yarn` to install all dependencies.
2. Set up the Wormhole Local Validator, as outlined in the [documentation](https://book.wormhole.com/technical/env/wlv.html).
3. Run `npm run evm` and `npm run wormhole` to start the Wormhole Local Validator.
4. Run the following commands to deploy and initialize the contracts, as well as mint an Avatar and Item:

- `yarn hardhat test:wormhole:deploy --network wormhole1` -- deploys contracts on the main network
- `yarn hardhat test:wormhole:deploy --network wormhole2` -- deploys contracts on the satellite network
- `yarn hardhat test:wormhole:initial-setup --network wormhole1` -- initializes remotes and sprays ETH
- `yarn hardhat test:wormhole:initial-setup --network wormhole2` -- initializes remotes and sprays ETH

5. Run the following commands to mint the Avatar cross-chain:

- `yarn hardhat test:wormhole:avatar-mint-out --network wormhole1` -- emits a Wormhole message
- `yarn hardhat test:wormhole:avatar-mint-in --network wormhole2` -- mints the Avatar cross-chian

6. Run the following command again and expect an error:

- `yarn hardhat test:wormhole:avatar-mint-in --network wormhole2`

7. Run the following command to send the Item cross-chain:

- `yarn hardhat test:wormhole:item-bridge-out --network wormhole1` -- emits a Wormhole message and burns the Item
- `yarn hardhat test:wormhole:item-bridge-in --network wormhole2` -- mints the Item on the satellite chain
- `yarn hardhat test:wormhole:item-bridge-out --network wormhole2` -- emits a Wormhole message and burns the Item
- `yarn hardhat test:wormhole:item-bridge-in --network wormhole1` -- mints the Item on the main chain
- `yarn hardhat test:wormhole:item-bridge-out --network wormhole1` -- emits a Wormhole message and burns the Item
- `yarn hardhat test:wormhole:item-bridge-in --network wormhole2` -- mints the Item on the satellite chain

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