What is the correct way to turn off upgradeability in a UUPSUpgradeable V5 contract?

I've been pondering this issue for weeks because according to UUPSUpgradeable V5 documentation this is possible.

This is the only thing I've been able to find regarding the matter:

I know that I need to create a customized implementation of the original contract, but what modification should be made to safely turn off upgradeability in a UUPSUpgradeable V5 contract?

I have tried a couple of tests on the Sepolia network (attached contract because I can't attach any more links): 0x6a23937EA070f090d6a8eADdEE2B823C2b70fF7b
2 / 2

I think the easiest way it to overwrite the authorizeUpgrade function. You can just make it revert every time.

1 Like

also thought about this, but the final goal its to not display the ā€˜upgradeToAndCallā€™ function at all, and to modify the ā€˜_authorizeUpgradeā€™ in that way will probably cause an update error.

Well I guess the answer you are looking for is right underneath the message you linked. If you upgrade first to a version that does not conduct a rollback check and then upgrade that version to the version without any UUPS functionality, then that would probably work.