Coder Social home page Coder Social logo

Comments (7)

charles-cooper avatar charles-cooper commented on May 30, 2024

maybe the name proxies: makes sense instead of implements storage:

from vyper.

charles-cooper avatar charles-cooper commented on May 30, 2024

Every single contract that uses storage slots needs to define it's storage layout:

all contracts implicitly define a storage layout just by declaring variables. so we could even skip the storage keyword and instead of having the storage layout be a named member on the module, just have:

proxies: parent

from vyper.

charles-cooper avatar charles-cooper commented on May 30, 2024

@makemake-kbo what are you thinking as syntax for safely calling a contract via delegatecall?

a couple ideas:

delegatecall SomeContract(*args)
SomeContract.__delegate_call__(*args)

(both of these would presumably have a compile time check that SomeContract proxies self)

from vyper.

makemake-kbo avatar makemake-kbo commented on May 30, 2024

@charles-cooper
i think both look fine and would be ok with either. i have a slight preference for the first option

Every single contract that uses storage slots needs to define it's storage layout:

all contracts implicitly define a storage layout just by declaring variables. so we could even skip the storage keyword and instead of having the storage layout be a named member on the module, just have:

proxies: parent

the idea with the more verbose syntax was that using storage is something extra. i wanted to highlight the importance of storage, if that makes sense. another thing is that you could technically reuse the storage patterns but thats probably not that useful and might be harmful if missused.

id be fine with changing it if it adds confusion or if it looks too complicated.

from vyper.

charles-cooper avatar charles-cooper commented on May 30, 2024

by the way, i want to point out that this proposal is useful even without the presence of delegatecall. for instance, off-chain tools might want to have the "storage layout interface" to figure out how to interpret the storage space of a contract.

from vyper.

cyberthirst avatar cyberthirst commented on May 30, 2024

I like the idea.

I think that adding the storage kw is unnecessary. I would argue that the same holds even for the proxies kw - couldn't it be implicit in the use of delegatecall?

Also the word proxies seems to be a bit too narrow and not capturing the whole semantics of delegatecall.

How would the storage compatibility be defined? Slot addrs and type compatibility? I think that even syntactic compatibility is interesting (eg swapped two addresses in the logic - eg operator vs owner).

Lastly, I would rather opt for just a compiler warning rather than a compile error, seems too restrictive.

from vyper.

charles-cooper avatar charles-cooper commented on May 30, 2024

How would the storage compatibility be defined? Slot addrs and type compatibility? I think that even syntactic compatibility is interesting (eg swapped two addresses in the logic - eg operator vs owner).

i think slot, type, and name should all be equal

from vyper.

Related Issues (20)

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.