# @chainfusion/chainfusion-contracts

> This repository contains Solidity contracts with bridging logic.

Latest version **0.1.3** (published 2025-04-08) · LGPL-3.0 license · 0 weekly downloads

## Install

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

## Health

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

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

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2025-04-08 |
| First published | 2022-11-08 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12 |
| Dependencies | 12 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ChainFusion |
| Maintainers | chainfusion-floodcode |

## Links

- npm: https://www.npmjs.com/package/@chainfusion/chainfusion-contracts
- npm.io page: https://npm.io/package/@chainfusion/chainfusion-contracts

## Dependencies (12)

- [rlp](https://npm.io/package/rlp.md) ^3.0.0
- [glob](https://npm.io/package/glob.md) ^7.2.3
- [yaml](https://npm.io/package/yaml.md) ^2.1.3
- [cpy-cli](https://npm.io/package/cpy-cli.md) ^4.2.0
- [minimatch](https://npm.io/package/minimatch.md) ^3.1.2
- [package-name](https://npm.io/package/package-name.md) ^0.1.0
- [@noble/curves](https://npm.io/package/@noble/curves.md) ^1.8.1
- [@noble/ed25519](https://npm.io/package/@noble/ed25519.md) ^2.2.3
- [@openzeppelin/contracts](https://npm.io/package/@openzeppelin/contracts.md) ^4.9.6
- [@ethersproject/bignumber](https://npm.io/package/@ethersproject/bignumber.md) ^5.7.0
- [@openzeppelin/hardhat-upgrades](https://npm.io/package/@openzeppelin/hardhat-upgrades.md) ^3.9.0
- [@nomicfoundation/hardhat-toolbox](https://npm.io/package/@nomicfoundation/hardhat-toolbox.md) ^5.0.0

## Recent versions

- 0.1.3 (latest) — 2025-04-08
- 0.1.2 — 2025-03-13
- 0.1.1 — 2025-03-13
- 0.1.0 — 2025-03-04
- 0.0.45 — 2023-02-20
- 0.0.44 — 2022-12-21
- 0.0.43 — 2022-12-07
- 0.0.42 — 2022-11-21
- 0.0.41 — 2022-11-08
- 0.0.40 — 2022-11-08

## README

# ChainFusion Contracts

This repository contains Solidity contracts with bridging logic.

RelayBridge is a cross-chain system that acts as a bridge to transfer tokens and assets between two different blockchain platforms.

RelayBridge provides blockchain interoperability by connecting different blockchain networks. Thus, it allows users to experience the distinctive features of each network and the additional benefits of a chain of nodes.

When a user initiates a token transfer from chain A to chain B, the assets are first sent to a relay node on chain A. The relay node then sends the same number of tokens to chain B and maintains liquidity at destination B.

RelayBridge provides interaction between blockchain networks using various consensus mechanisms. They enable interoperable token transfer, data transfer, digital asset transfer, and smart contract instruction transfer between two different platforms. With RelayBridges, users can deploy digital assets stored on one chain to applications running on another, facilitating fast and low-cost transactions for tokens hosted on a less scalable blockchain.

## Development

### Install Packages

```
$ npm install
```

### Compile Contracts

```
$ npm run compile
```

### Run Tests

```
$ npm run test
```

## Deployment and Verification

First of all, copy `.env.example` into `.env` and set up all required variables inside

### Deploy Contracts

In this example we are deploying to `ternopil` testnet. To deploy to different chain, `--network` parameter should be changed.

Deployment involves running two scripts in sequence. The first script is deployed once, on ChainFusion network.

```
$ npx hardhat --network ternopil run scripts/deploy-chainfusion.ts
```

The second script is executed for each new chain to deploy chain contracts, like `bg1`.

```
$ npx hardhat --network bg1 run scripts/deploy-chain.ts
```

### Verify Contracts

To verify contracts, you need to specify network, contract address and constructor parameters (if present).

```
$ npx hardhat --network goerli verify <CONTRACT_ADDRESS> <CONSTRUCTOR_PARAMETERS>
```

Or you can set `VERIFY` variable to `true` while deploying contracts to automatically verify them afterwards.

```
$ VERIFY=true npx hardhat --network ternopil run scripts/deploy-chainfusion.ts
```

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