# @bonsaiswapv3/swap-router-contracts

> Smart contracts for swapping on Bonsaiswap V2 and V3

Latest version **2.0.2** (published 2023-02-22) · GPL-2.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @bonsaiswapv3/swap-router-contracts
pnpm add @bonsaiswapv3/swap-router-contracts
yarn add @bonsaiswapv3/swap-router-contracts
bun add @bonsaiswapv3/swap-router-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 | 2.0.2 |
| Published | 2023-02-22 |
| First published | 2023-01-03 |
| Weekly downloads | 0 |
| License | GPL-2.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 5 |
| Unpacked size | 387.3 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | alcanal |
| Keywords | bonsaiswap, v2, v3 |

## Links

- npm: https://www.npmjs.com/package/@bonsaiswapv3/swap-router-contracts
- npm.io page: https://npm.io/package/@bonsaiswapv3/swap-router-contracts

## Dependencies (5)

- [dotenv](https://npm.io/package/dotenv.md) ^14.2.0
- [hardhat-watcher](https://npm.io/package/hardhat-watcher.md) ^2.1.1
- [@bonsaiswapv3/core](https://npm.io/package/@bonsaiswapv3/core.md) 2.0.1
- [@bonsaiswapv3/periphery](https://npm.io/package/@bonsaiswapv3/periphery.md) 2.0.3
- [@openzeppelin/contracts](https://npm.io/package/@openzeppelin/contracts.md) 3.4.2-solc-0.7

## Recent versions

- 2.0.2 (latest) — 2023-02-22
- 2.0.1 — 2023-01-03

## README

# Bonsaiswap Swap Router

This repository contains smart contracts for swapping on the Bonsaiswap V3 protocols.


## Local deployment

In order to deploy this code to a local testnet, you should install the npm package
`@bonsaiswapv3/swap-router-contracts`
and import bytecode imported from artifacts located at
`@bonsaiswapv3/swap-router-contracts/artifacts/contracts/*/*.json`.
For example:

```typescript
import {
  abi as SWAP_ROUTER_ABI,
  bytecode as SWAP_ROUTER_BYTECODE,
} from '@bonsaiswapv3/swap-router-contracts/artifacts/contracts/SwapRouter02.sol/SwapRouter02.json'

// deploy the bytecode
```

This will ensure that you are testing against the same bytecode that is deployed to
mainnet and public testnets, and all Bonsaiswap code will correctly interoperate with
your local deployment.

## Tests

Some tests use Hardhat mainnet forking and therefore require an archive node.
Either create a `.env` file in the workspace root containing:

```
ARCHIVE_RPC_URL='...'
```

Or set the variable when running tests:

```
export ARCHIVE_RPC_URL='...' && npm run test
```

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