
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@morpho-labs/ethers-multicall
Advanced tools
⚡🚀 Call multiple view functions, from multiple Smart Contracts, in a single RPC query!
⚡🚀 Call multiple view functions, from multiple Smart Contracts, in a single RPC query!
Querying an RPC endpoint can be very costly (100+ queries) when loading data from multiple smart contracts. With multicall, batch these queries into a single, on-chain query, without additional over-head!
This is the standalone package of the library formerly created & used by Zapper.
npm install @morpho-labs/ethers-multicall
yarn add @morpho-labs/ethers-multicall
import { ethers } from "ethers";
import { EthersMulticall } from "@morpho-labs/ethers-multicall";
const provider = new ethers.providers.JsonRpcBatchProvider("...");
const multicall = new EthersMulticall(provider);
const uni = multicall.wrap(
new ethers.Contract("0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984", UniswapAbi)
); // make sure to always wrap contracts to benefit from multicalls
Promise.all([uni.name(), uni.symbol(), uni.decimals()]).then(console.log);
const performCall = async (address: string) => {
const erc20 = await multicall.wrap(new ethers.Contract(address, ERC20Abi));
try {
const symbol = await erc20.symbol();
} catch {
return console.error("An error occurred while fetching the symbol of token:", address);
}
};
Promise.all(
[
"0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd", // valid GUSD token address
"0x0000000000000000000000000000000000000000", // invalid ERC20 token address
].map(performCall)
);
// prints 2 errors:
// An error occurred while fetching the symbol of token: 0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd
// An error occurred while fetching the symbol of token: 0x0000000000000000000000000000000000000000
FAQs
⚡🚀 Call multiple view functions, from multiple Smart Contracts, in a single RPC query!
The npm package @morpho-labs/ethers-multicall receives a total of 192 weekly downloads. As such, @morpho-labs/ethers-multicall popularity was classified as not popular.
We found that @morpho-labs/ethers-multicall demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.