
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
human-standard-token-abi
Advanced tools
A simple node module that exports the [Ethereum ABI](1) for [ERC 20](2) compatible tokens.
A simple node module that exports the Ethereum ABI for ERC 20 compatible tokens.
Requires the web3 API to be available, either by initailizing it yourself, or using a web3-injecting Javascript environment, like Geth, MetaMask, or Mist.
var abi = require('human-standard-token-abi')
var token = web3.eth.contract(abi).at(contractAddress)
var addr = web3.eth.accounts[0]
// Get the token name
token.name.call(function(err, name) {
if(err) { console.log(err) }
if(name) { console.log('The token name is: ' + name) }
})
// Get the token symbol
token.symbol.call({from: addr}, function(err, symbol) {
//ABI expects string here,
if(err) { console.log(err) }
console.log('Token symbol: ' + symbol)
})
token.totalSupply.call({from: addr}, function(err, totalSupply) {
console.log(totalSupply)
})
token.balanceOf.call(web3.eth.accounts[0], function (err, bal) {
if (err) { console.error(err) }
console.log('balance is ' + bal.toString(10))
})
var value = '100' // Base 10, accounts for decimals.
token.transfer(toAddress, value, { from: addr }, function (err, txHash) {
if (err) console.error(err)
if (txHash) {
console.log('Transaction sent')
console.dir(txHash)
}
})
First install http-server
(npm install -g http-server
).
Then run it in this folder: http-server
.
Then visit that port, probably something like: http://localhost:8080/example
.
If you edit example/index.js
, you'll have to rebuild by running npm run build
.
FAQs
A simple node module that exports the [Ethereum ABI](1) for [ERC 20](2) compatible tokens.
We found that human-standard-token-abi 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
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.