Storage Layout Fetcher is a lightweight library for fetching storage layouts of verified contracts.
To install Storage Layout Fetcher, use npm or pnpm:
npm install storage-layout-fetcheror
pnpm add storage-layout-fetcherHere is a basic example of how to use Fetch Fun:
import fetchStorageLayout from 'storage-layout-fetcher';
const storageLayout = await fetchStorageLayout('0x06012c8cf97bead5deae237070f9587f8e7a266d', 'mainnet');-
fetch source code from explorers.
-
ensure the solc_version is greater than 0.6.8
if not, modify the solc_version to 0.6.8 and try to modify the contract to be compatible with 0.6.8
-
compile and return the storage layout.
We welcome contributions to Storage Layout Fetcher! If you have any ideas, suggestions, or bug reports, please open an issue on our GitHub repository.
To contribute code, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes and commit them (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Open a pull request.
Please ensure your code adheres to our coding standards and includes appropriate tests.
This project is licensed under the MIT License.