-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
diamondCut
utilities
#65
Comments
Include a |
Just to summarize the problem statement here. The Diamond proxy is becoming an increasingly popular standard but managing deployments and upgrades is a challenging task with limited developer tooling available. Some of the key issues underlying are as follows:
Some goals I believe are worthwhile pursuing here is to provide a package or plugin for developers to create a valid |
Awesome PR and definitely a useful thing to add. Just wanted to link to Nick Mudge's diamond util's that he puts in his hardhat template repos. They've been useful when writing update/deploy scripts. The sample deploy script uses the Util Functions. Although I think @0xCourtney's work is great. There are some cool features in the official sample utils, though. An example would be when I'm trying to implement solidstate libraries into my code. I'll often create a facet for a specific area, like an ERC1155Facet which isn't that different than the SolidStateERC1155Mock (but with no constructor). If I tried to add all selectors from that Facet it would error because DiamondLoupe's have to implement 165. So with the official sample tool you could do something like this in your deploy, using Nick's getSelectors method.
|
Thanks for the feedback, I would agree that having the Alternatively, you could also add the selector which you don't want into the // async function addUnregisteredSelectors(diamond: Diamond, contracts: Contract[], exclude: string[] = []): Promise<FacetCut[]>
let facetCut = await addUnregisteredSelectors(Diamond, [Test1Facet, Test2Facet], ["0x01234567"]); |
The
diamondCut
function is complex, and many users would benefit from a package to assist with adding/replacing/removing function selectors from diamond proxies.The text was updated successfully, but these errors were encountered: