gemstation / gemforge

Command-line tool for building, deploying and upgrading Diamond Standard contracts on EVM chains.
https://gemforge.xyz
MIT License
17 stars 4 forks source link

Upgrade the entire facet if a single function changes #10

Closed hiddentao closed 1 year ago

hiddentao commented 1 year ago

This is already done by virtue of how the upgrade mechanism works -> https://github.com/gemstation/gemforge/blob/master/src/shared/diamond.ts#L105

For all functions that should exist in the diamond, it checks the current on-chain facet bytecode against the function's parent facet contract's current artifact bytecode. If there is a difference then the facet and given function are replaced in the diamond.