Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@rsksmart/ethr-did-utils
Advanced tools
@rsksmart/ethr-did-utils
Utils for Ethr DID method in RSK network.
npm i ganache-core @rsksmart/ethr-did-utils
You can start a Ganache server and deploy the registry from a new terminal or from Node.js
Open a new terminal browse to the repo dir or clone it and run
npm run start-ganache-and-deploy
The output should be
Ganache started on port 8545 - rpcUrl: http://localhost:8545
Ethr DID Registry depoyed - registryAddress: 0xe87c1cd63e5eed53db7d4e839adb7a4646ecbf8d
netowrks: [ { name: 'ganache', rpcUrl: http://localhost:8545, registryAddress: 0xe87c1cd63e5eed53db7d4e839adb7a4646ecbf8d }]
mnemonic: cover lift maple eagle common differ trash stomach scene security section dismiss
Useful for demos
To start the server and deploy from Node.js
const { startGanacheServerAndDeployEthrDidRegistry } = require('@rsksmart/ethr-did-utils')
const port = process.env.PORT || 8545
startGanacheServerAndDeployEthrDidRegistry(port).then(({ blockchain, server, rpcUrl, eth, registryAddress, registry }) => {
console.log(`Ganache started on port ${port} - rpcUrl: ${rpcUrl}`)
console.log(`Ethr DID Registry depoyed - registryAddress: ${registryAddress}`)
console.log(`netowrks: [ { name: 'ganache', rpcUrl: ${rpcUrl}, registryAddress: ${registryAddress} }]`)
console.log(`mnemonic: ${blockchain.mnemonic}`)
eth.accounts() // use ethjs
.then(([me]) => registry.identityOwner(me)) // use ethr did registry contract
.then(result => result[0])
.then(owner => console.log(`My identity owner is ${owner}`))
.then(() => server.close()) // use server.close to exit ganache
})
This sample script is in demo.js and can be run with node demo.js
The output should be
Ganache started on port 8545 - rpcUrl: http://localhost:8545
Ethr DID Registry depoyed - registryAddress: 0x351e99cafac04bd08333b06f1f8257ec5abfe242
netowrks: [ { name: 'ganache', rpcUrl: http://localhost:8545, registryAddress: 0x351e99cafac04bd08333b06f1f8257ec5abfe242 }]
mnemonic: host spin zero toddler chat tortoise project buffalo example ship chair human
My identity owner is 0xf9bcb26dbd250b22162ee513e9c6f9f373ced425
Useful for testing
async function startGanacheServerAndDeployEthrDidRegistry(port)
Start a Ganache server and deploy Ethr DID Registry
Parameters:
port
port to for the server to listen on - default 8545
Returns: Promise<Object>
with keys of startGanacheServer
and deployEthrDidRegistry
,
server
blockchain
eth
rpcUrl
registry
registryAddress
async function startGanacheServer(port)
Parameters:
port
port to for the server to listen on - default 8545
Returns: Promise<Object>
with keys
server
the Ganache server started. It has a function close
to close the server connectionblockchain
the success result of the server listen callbacketh
an ethjs
instance using via HTTP the started serverrpcUrl
the URL to use to connect to the node via RPCasync function deployEthrDidRegistry(eth)
Start a Ganache server and deploy Ethr DID Registry
It works only with auto-miner set on
Parameters:
eth
an ethjs
instance using via HTTP the started serverReturns:
registry
an ethjs-contract
instance of the deployed registryregistryAddress
the address of the deployed Ethr DID RegistryFAQs
Utils for Ethr DID method in RSK network
We found that @rsksmart/ethr-did-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.