Giter VIP home page Giter VIP logo

Comments (2)

mudgen avatar mudgen commented on July 28, 2024

Someone could not remove a function that is defined directly in a diamond proxy. But such functions still need to be returned by the loupe functions which means they need to be added to storage with the address address(this). So the require statement checks if there is an attempt to remove an immutable function and throws an error if so.

The EIP2535 standard says this:

All immutable functions must be emitted in the DiamondCut event as new functions added. And the loupe functions must return information about immutable functions if they exist. The facet address for an immutable function is the diamond’s address. Any attempt to delete or replace an immutable function must revert.

from diamond.

arialblack14 avatar arialblack14 commented on July 28, 2024

@mudgen That makes total sense. Thank you for clearing that out!

I was trying to understand why that check wasn't added on the LibDiamond.addFunctions() which makes it possible to add address(this) as a facetAddress. Then noone will be able to remove or replace that function.
But it is intended behaviour according to the EIP.

from diamond.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.