Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@0xweb/hardhat
Advanced tools
0xWeb
plugin for HardhatThe plugin generates 0xWeb
classes for compiled solidity contracts, making the blockchain development transparent.
We use 📦 dequanto library for the classes
# install 0xweb
$ npm i 0xweb -g
# initiallize 0xweb and hardhat project
$ 0xweb init --hardhat
any/directory/Foo.sol
pragma solidity ^0.8.2;
contract Foo {
string public name;
function setName(string memory _name) public {
name = _name;
}
}
Plugin adds also ability to specify the
sources
folder. As per default this is/contracts/**.sol
$ npx hardhat compile --sources ./any/directory/
example.ts
import { Foo } from '@0xweb/hardhat/Foo/Foo.ts'
import { HardhatProvider } from '@dequanto/hardhat/HardhatProvider'
// automatically deploys the contract to hardhat chain
const deployer = new HardhatProvider();
const foo = await deployer.deployClass<Foo>(Foo, { arguments: [ 'Hello' ] });
// write
const tx = await foo.setName('Hello world')
const receipt = await tx.wait();
// read
const text = await foo.name();
If the contract is already deployed, initialize the contract with the Address as normal class. If the contract is deployed to any other chain - set also the client in constructor
example.ts
import { Foo } from '@0xweb/hardhat/Foo/Foo.ts'
import { EthWeb3Client } from '@dequanto/clients/EthWeb3Client'
const client = new EthWeb3Client();
const foo = new Foo('0x12345...', client);
// write
const tx = await foo.setName('Hello world');
const receipt = tx.wait();
// read
const text = await foo.name();
npx hardhat compile --source /foo/bar/qux
- compiles solidity files which are located outside the /contracts
foldernpx hardhat compile --artifacts /dist
- set custom folder for artifacts (ABI JSONs and TS contracts)npx hardhat compile --watch
- Compile the sources and waits to recompile on changesFAQs
0xweb plugin for Hardhat
The npm package @0xweb/hardhat receives a total of 1,013 weekly downloads. As such, @0xweb/hardhat popularity was classified as popular.
We found that @0xweb/hardhat 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.