10 Comments
User's avatar
Josh's avatar

Hey Nick, just wanted to mention there's a typo in your example. Where you're defining the FriendsFacet.sol file, you're naming the contract PersonsFacet and I think you want it to be FriendsFacet.

Nick Mudge πŸ’Ž's avatar

Hi Josh. You are right. I fixed it. Thanks for that.

sowgandhi's avatar

Hi Nick, when using an upgraded facet where you have added a new function with the DiamondCut is it common to get an error: "Error: missing revert data in call exception; Transaction reverted without a reason." When printing out the contract it looks like the newly added function did make it but I am unable to use any functions that were added added.

Nick Mudge πŸ’Ž's avatar

I don't know why you are getting that error. Just a guess, maybe you are trying to call the function at the wrong contract address.

sowgandhi's avatar

hm, I can call any function from the facets first deployment. However, when I try to call functions that were added to the facet with an upgrade they error out. Is there an example of upgrading an existing facet I can check out?

Nick Mudge πŸ’Ž's avatar

Are you calling functions on the diamond address or facet address? Functions are added to a diamond, not a facet. So you have to call functions on the diamond address.

sowgandhi's avatar

I am calling functions on the diamond address.

Nick Mudge πŸ’Ž's avatar

Great. Make sure that you are calling functions with enough gas. Beyond that try some of the debugging techniques in this article: https://dev.to/mudgen/how-to-debug-code-2850

Also, one or more of the tutorials in Awesome Diamonds may help: https://github.com/mudgen/awesome-diamonds

sowgandhi's avatar

I did see these tests: https://github.com/mudgen/diamond-1-hardhat/blob/main/test/diamondTest.js#L70

How would you continue to add functions to the Test1Facet after this?

User's avatar
Comment deleted
Oct 21, 2022
Comment deleted
Nick Mudge πŸ’Ž's avatar

Thanks for telling me this. I fixed it.