Socket
Socket
Sign inDemoInstall

@mean-finance/call-simulation

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mean-finance/call-simulation

This repository adds existing contracts the ability to perform stateless simulations


Version published
Maintainers
5
Created
Source

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:

$ forge build

Clean

Delete the build artifacts and cache directories:

$ forge clean

Compile

Compile the contracts:

$ forge build

Coverage

Get a test coverage report:

$ forge coverage

Format

Format the contracts:

$ forge fmt

Gas Usage

Get a gas report:

$ forge test --gas-report

Lint

Lint the contracts:

$ pnpm lint

Test

Run the tests:

$ forge test

License

This project is licensed under GLP 3.0.

Keywords

FAQs

Package last updated on 02 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc