
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
ethereum-smart-contracts
Advanced tools
Provides basic ERC20 tokens and abi for using with web3.js
This package provides an ability to access and use basic smart contracts without any need to compile them manually.
First of all, import a module
const ContractsContext = require("ethereum-smart-contracts")
Then there might be two ways:
const context = ContractsContext.withUri("https://mainnet.infura.io/", options)
web3
instance directlyconst context = new ContractsContext(web3, options)
options
parameter should have the next layout: see parameteroptions
structure.from
,gas
andgasPrice
are needed to be provided,data
is optional.
After initial setup contracts are available to use them.
For example, to load any ERC20
-token (let use EOS token address) you need to do
const tokenAddress = "0x7b39940dbac110f1227d37c395675def270afcd7"
const erc20Token = context.getERC20TokenAt(tokenAddress)
// to get token's total supply
const totalSupply = await erc20Token.methods.totalSupply().call()
console.log(`#> totalSupply = ${totalSupply}`)
// or if you want to get user's token balance
const userAddress = "0x00000000000000000000000000000000000000b1"
const balanceOf = await erc20Token.methods.balanceOf(userAddress).call()
console.log(`#> user balance (${userAddress}) = ${balanceOf}`)
Some example of how to use smart contracts you can find in examples directory
FAQs
Provides basic ERC20 tokens and abi for using with web3.js
The npm package ethereum-smart-contracts receives a total of 0 weekly downloads. As such, ethereum-smart-contracts popularity was classified as not popular.
We found that ethereum-smart-contracts demonstrated a not healthy version release cadence and project activity because the last version was released 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.