Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
hardhat-storage-layout
Advanced tools
Hardhat plugin for exporting the contract storage layout
Weekly downloads
Readme
Generate Ethereum smart contract storage layout with Hardhat. This plugin saves time and avoids human error when a
developer tries to update a specific storage slot
in a remote solidity contract. For more info about the storage
layout, please refer to the official solidity documentation.
yarn add --dev hardhat-storage-layout
hardhat.config.js
:require('hardhat-storage-layout');
yarn hardhat check
Or
const hre = require("hardhat");
async function main() {
....
await
hre.storageLayout.export();
}
┌─────────────────┬────────────────┬──────────────┬────────┬─────────────────────────────────────────────────────┬────────────────┐
│ contract │ state_variable │ storage_slot │ offset │ type │ numberOfBytes │
├─────────────────┼────────────────┼──────────────┼────────┼─────────────────────────────────────────────────────┤────────────────┤
│ ERC20 │ _balances │ 0 │ 0 │ t_mapping(t_address,t_uint256) │1 │
│ ERC20 │ _allowances │ 1 │ 0 │ t_mapping(t_address,t_mapping(t_address,t_uint256)) │1 │
│ ERC20 │ _totalSupply │ 2 │ 0 │ t_uint256 │1 │
│ ERC20 │ _name │ 3 │ 0 │ t_string_storage │1 │
│ ERC20 │ _symbol │ 4 │ 0 │ t_string_storage │1 │
│ WatermelonToken │ _balances │ 0 │ 0 │ t_mapping(t_address,t_uint256) │1 │
│ WatermelonToken │ _allowances │ 1 │ 0 │ t_mapping(t_address,t_mapping(t_address,t_uint256)) │1 │
│ WatermelonToken │ _totalSupply │ 2 │ 0 │ t_uint256 │1 │
│ WatermelonToken │ _name │ 3 │ 0 │ t_string_storage │1 │
│ WatermelonToken │ _symbol │ 4 │ 0 │ t_string_storage │1 │
└─────────────────┴────────────────┴──────────────┴────────┴─────────────────────────────────────────────────────┘────────────────┘
FAQs
Hardhat plugin for exporting the contract storage layout
The npm package hardhat-storage-layout receives a total of 1,967 weekly downloads. As such, hardhat-storage-layout popularity was classified as popular.
We found that hardhat-storage-layout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.