Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@emo-eth/create2-clones-with-immutable-args
Advanced tools
Factory for deploying clones with immutable parameters to deterministic addresses.
Enables creating clone contracts with immutable arguments to deterministic addresses.
The immutable arguments are stored in the code region of the created proxy contract, and whenever the proxy is called, it reads the arguments into memory, and then appends them to the calldata of the delegate call to the implementation contract. The implementation contract can thus read the arguments straight from calldata.
By doing so, the gas cost of creating parametrizable clones is reduced, since there's no need to store the parameters in storage, which you need to do with EIP-1167. The cost of using such clones is also reduced, since storage loads are replaced with calldata reading, which is far cheaper.
In other word, if you know you are not gonna need parametrization and just want exact copies, then you can keep using EIP-1167, otherwise, clones-with-immutables is cheaper.
Clone factory contracts should use the Create2ClonesWithImmutableArgs
library. Create2ClonesWithImmutableArgs.clone()
is the main function for creating clones.
Contracts intended to be cloned should inherit from Clone
to get access to the helper functions for reading immutable args.
To see an example usage of the library, check out ExampleClone
and ExampleCloneFactory
.
To install with DappTools:
dapp install jameswenzel/clones-with-immutable-args
To install with Foundry:
forge install jameswenzel/clones-with-immutable-args
To install with Hardhat:
coming soon? :)
This project uses Foundry as the development framework.
make update
make build
make test
FAQs
Factory for deploying clones with immutable parameters to deterministic addresses.
The npm package @emo-eth/create2-clones-with-immutable-args receives a total of 2 weekly downloads. As such, @emo-eth/create2-clones-with-immutable-args popularity was classified as not popular.
We found that @emo-eth/create2-clones-with-immutable-args 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.