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.
hardhat-storage-layout-changes
Advanced tools
Hardhat plugin to check for storage layout changes
When working with complex and upgradable contracts, it can be difficult to manually see whether some solidity changes broke the storage layout or not. A mistake can cause undefined behavior in deployed contracts. This plugin aims to help notice any storage layout breakings while dev works on solidity changes.
npm install hardhat-storage-layout-changes
Import the plugin in your hardhat.config.js
:
require("hardhat-storage-layout-changes");
Or if you are using TypeScript, in your hardhat.config.ts
:
import "hardhat-storage-layout-changes";
This plugin adds the storage-layout task to Hardhat:
Usage: hardhat [GLOBAL OPTIONS] storage-layout [--check] [--update]
OPTIONS:
--check Checks if storage layout has changed
--update Updates storage layout artifact
This plugin extends the HardhatUserConfig
's ProjectPathsUserConfig
object with an optional
storageLayouts
field and also adds a storageLayoutConfig
.
This is an example of how to set it:
module.exports = {
paths: {
storageLayouts: ".storage-layouts",
},
storageLayoutConfig: {
contracts: ["Pool"],
fullPath: false
};
};
npx hardhat storage-layout --check
Contract: Pool
"accounts": at same location
"user": at same location
"balance": at same location
"owner": changed slot from 1 to 2
"lastUpdate": found new storage entry at slot 1 offset 0
"owner": found new storage entry at slot 2 offset 0
Error: Storage Layout Changed. If this was intentional, please update the storage layout files using "npx hardhat storage-layout --update".
npx hardhat storage-layout --update
Contract: Pool
updating Pool.json
FAQs
Hardhat plugin to check for storage layout changes
The npm package hardhat-storage-layout-changes receives a total of 466 weekly downloads. As such, hardhat-storage-layout-changes popularity was classified as not popular.
We found that hardhat-storage-layout-changes 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
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.