Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Install with pip install w3multicall
https://pypi.org/project/w3multicall/
Want to support this project ? You can help us by:
This software is derived from multicall.py. However, multicall.py is built on asyncio and does not support multi-threading. This implementation fixes that.
From the root folder w3multicall
do pip install .
to build and install the package in the current python environment
Multicall smart contract are deployed on numerous chains and can help reduce the strain put on RPC by order of magnitude by batching multiple requests into a single one.
from web3 import Web3
from w3multicall.multicall import W3Multicall
w3 = Web3(Web3.HTTPProvider(rpc))
w3_multicall = W3Multicall(w3)
w3_multicall.add(W3Multicall.Call(
'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', # USDC contract address
'balanceOf(address)(uint256)', # method signature to call
'0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045') # vitalik.eth
)
results = w3_multicall.call()
print("Vitalik holds {:.2f} USDC".format(results[0]/10**6))
w3_pool = W3Pool([
W3(Web3(Web3.HTTPProvider('https://eth-rpc.gateway.pokt.network')), 5),
W3(Web3(Web3.HTTPProvider('https://ethereum.publicnode.com')), 5),
W3(Web3(Web3.HTTPProvider('https://rpc.flashbots.net/')), 5)
], logger)
executor = W3MulticallExecutor(w3_pool, processes=len(w3_pool.w3s))
bayc_futures = []
azuki_futures = []
moonbird_futures = []
for i in range(1, 10):
bayc_futures.append(executor.submit(W3Multicall.Call(
'0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D', # BAYC NFT contract address
'ownerOf(uint256)(address)',
i)))
azuki_futures.append(executor.submit(W3Multicall.Call(
'0xED5AF388653567Af2F388E6224dC7C4b3241C544', # Azuki NFT contract address
'ownerOf(uint256)(address)',
i)))
moonbird_futures.append(executor.submit(W3Multicall.Call(
'0x23581767a106ae21c074b2276D25e5C3e136a68b', # Moonbird NFT contract address
'ownerOf(uint256)(address)',
i)))
for i in range(len(bayc_futures)):
print("The owner of the BAYC Nº{} is {}".format(i + 1, bayc_futures[i].get()))
for i in range(len(azuki_futures)):
print("The owner of the Azuki Nº{} is {}".format(i + 1, azuki_futures[i].get()))
for i in range(len(moonbird_futures)):
print("The owner of the Moonbird Nº{} is {}".format(i + 1, moonbird_futures[i].get()))
FAQs
Python interface and utilities for Solidity multicall contract
We found that w3multicall demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.