# @mean-finance/call-simulation

> This repository adds existing contracts the ability to perform stateless simulations

Latest version **0.0.2** (published 2023-08-02) · 0 weekly downloads

## Install

```sh
npm install @mean-finance/call-simulation
pnpm add @mean-finance/call-simulation
yarn add @mean-finance/call-simulation
bun add @mean-finance/call-simulation
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2023-08-02 |
| First published | 2023-07-31 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 44.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mean-Finance |
| Maintainers | fiboape, sambugs, 0xged, alejoamiras, nchamo |
| Keywords | blockchain, ethereum, forge, foundry, smart-contracts, solidity, template |

## Links

- npm: https://www.npmjs.com/package/@mean-finance/call-simulation
- npm.io page: https://npm.io/package/@mean-finance/call-simulation

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2023-08-02
- 0.0.1 — 2023-07-31

## README

# Call Simulation

It's fairly common to try to predict what a transaction might return, or how it would affect other contracts. There are
many ways to do so, ranging from complex solutions like Tenderly or Alchemy, to simple static calls. One popular way is
through the use of Multicall, which allows to group many different calls into one, therefore avoiding being rate limited
by RPCs.

However, there is one area where Multicall might not be the best solution. For example, if you tried to simulate
multiple swap transactions to figure out which one would yield better results, a Multicall won't work. Since the first
call would modify the storage and transfer tokens between accounts, it could happen than all other quotes would fail.
However, it would be interesting to be able to simulate these quotes without actually affecting the state.

And that's where this repository comes into place. The idea is to give existing contracts the ability to simulate calls
in a stateless way, so that they can be run independently from each other. Also, it provides the ability to simulate
these calls similarly to a Multicall, so as to avoid issues with RPC rate limiting.

## Usage

This is a list of the most frequently needed commands.

### Build

Build the contracts:

```sh
$ forge build
```

### Clean

Delete the build artifacts and cache directories:

```sh
$ forge clean
```

### Compile

Compile the contracts:

```sh
$ forge build
```

### Coverage

Get a test coverage report:

```sh
$ forge coverage
```

### Format

Format the contracts:

```sh
$ forge fmt
```

### Gas Usage

Get a gas report:

```sh
$ forge test --gas-report
```

### Lint

Lint the contracts:

```sh
$ pnpm lint
```

### Test

Run the tests:

```sh
$ forge test
```

## License

This project is licensed under GLP 3.0.

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