- fetch diamond infos and creates the example.diamond file
$ npx hardhat diamond loupe --address "0x123123..." -o "example.diamond"- the command creates the file example.diamond
<Diamond
address="0x123123123...."
test1Func1="Test1Facet"
/>
<contract
name="Test1Facet"
type="remote"
address="0x22222222222..."
/>- Now I add a new function from a new facet
<Diamond
address="0x123123123...."
test1Func1="Test1Facet"
test2Func1="Test2Facet"
/>
<contract
name="Test1Facet"
type="remote"
address="0x22222222222..."
/>
<!-- ADD test2Func1 FROM NEW FACET -->
<contract
name="Test2Facet"
type="local"
path="facets/Test2Facet.sol"
/>- now I cut the diamond with the new config
$ npx hardhat diamond cut example.diamond-
the command
4.1) deploys the new facet
6.2) update the diamond
8.3) update the local example.diamond file with new address of Test2Facet
<Diamond
address="0x123123123...."
test1Func1="Test1Facet"
test2Func1="Test2Facet"
/>
<contract
name="Test2Facet"
type="remote"
address="0x1111111111111"
/>
<contract
name="Test3Facet"
type="remote"
address="0x22222222222..."
/>