Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@kodex-data/flat-zeppelin
Advanced tools
A hardhat plugin to minify your complex solidity projects, reducing bundle size and optimizing module structure.
@kodex-data/flat-zeppelin
is a hardhat plugin that allows you to minify your complex solidity projects, reducing bundle size and optimizing module structure. It is especially useful for projects that rely on large libraries like OpenZeppelin.
You can install the plugin using Yarn or npm:
yarn add @kodex-data/flat-zeppelin
# or
npm install @kodex-data/flat-zeppelin
To use the plugin, add the following line at the top of your hardhat.config.ts
file:
import '@kodex-data/flat-zeppelin'
Then, add the following configuration object to your hardhat.config.ts
file:
export default <HardhatUserConfig>{
flatZeppelin: {
/** License added to the cleaned content */
license: 'MIT',
/** if provided, flatted solidity file will be saved to given path */
outputFile: 'flatted.sol',
/** Temporary directory for storing intermediate files */
tempDir: './.flat-zeppelin',
/** Directory to saved flatted typechain types */
targetDir: './typechain-types',
/** Whether to keep the temporary directory after running */
keepTemp: false,
/** Version to add to the flattened solidity content */
version: '0.8.4',
/** Whether to enable debug mode */
debug: false
},
// ...
}
To flat compile your contracts, run the following command:
npx hardhat flat-build
optimized output:
typechain-types
├── ERC165.ts
├── ERC20.ts
├── ERC20Permit.ts
├── ERC20PermitToken.ts
├── ERC721.ts
├── IERC20.ts
├── IERC20Metadata.ts
├── IERC20Permit.ts
├── IERC721.ts
├── IERC721Enumerable.ts
├── IERC721Metadata.ts
├── IERC721Receiver.ts
├── IGovernor.ts
├── IVotes.ts
├── Multicall2.ts
├── Ownable.ts
├── PhxCollectible.ts
├── Treasury.ts
├── Votes.ts
├── common.ts
├── factories
│ ├── ERC165__factory.ts
│ ├── ERC20PermitToken__factory.ts
│ ├── ERC20Permit__factory.ts
│ ├── ERC20__factory.ts
│ ├── ERC721__factory.ts
│ ├── IERC20Permit__factory.ts
│ ├── IERC20__factory.ts
│ └── index.ts
├── hardhat.d.ts
└── index.ts
normal typechain output:
typechain-types
├── @openzeppelin
│ └── contracts
│ └── token
│ ├── ERC20
│ │ ├── ERC20.ts
│ │ ├── IERC20.ts
│ │ └── extensions
│ │ └── draft-ERC20Permit.sol
│ │ └── ERC20Permit.ts
│ └── ERC721
│ ├── ERC721.ts
│ └── IERC721.ts
├── ERC20.ts
├── ERC20Permit.ts
├── ERC20PermitToken.ts
├── ERC721.ts
├── IERC20.ts
├── IERC721.ts
├── common.ts
├── contracts
│ ├── ERC20PermitToken.ts
├── factories
│ ├── @openzeppelin
│ │ └── contracts
│ │ └── token
│ │ ├── ERC20
│ │ │ ├── ERC20__factory.ts
│ │ │ ├── IERC20__factory.ts
│ │ │ └── extensions
│ │ │ └── draft-ERC20Permit.sol
│ │ │ └── ERC20Permit__factory.ts
│ │ └── ERC721
│ │ ├── ERC721__factory.ts
│ │ └── IERC721__factory.ts
│ ├── ERC20PermitToken__factory.ts
│ ├── ERC20Permit__factory.ts
│ ├── ERC20__factory.ts
│ ├── ERC721__factory.ts
│ ├── IERC20__factory.ts
│ ├── IERC721__factory.ts
│ └── contracts
│ └── ERC20PermitToken__factory.ts
└── index.ts
FAQs
A hardhat plugin to minify your complex solidity projects, reducing bundle size and optimizing module structure.
The npm package @kodex-data/flat-zeppelin receives a total of 2 weekly downloads. As such, @kodex-data/flat-zeppelin popularity was classified as not popular.
We found that @kodex-data/flat-zeppelin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.