Comments (7)
maybe the name proxies:
makes sense instead of implements storage:
from vyper.
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.
@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.
@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.
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.
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.
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)
- multiple eval of `sqrt()` argument HOT 1
- double eval of the slice start/length args
- incorrect topic logging in raw_log for non-literal expressions HOT 1
- double eval of raw_args in create_from_blueprint HOT 2
- Disallow `optimize` and `evm-version` `pragma`'s in `.vyi` files
- meta: venom IR roadmap HOT 1
- HashMap index checks when the subscript is folded
- Compilation errors due to not folded convert value
- CompilerPanic for concat on empty(Bytes)
- CodegenPanic for slice on empty(Bytes)
- Mistyped Loop Iterable
- Overriding Storage Allocator Does Not Handle Stateful Modules HOT 1
- Ambiguous Imports
- Constants Cannot Be Imported From .vyi Files
- External Call Kwargs Allowed for Call to __init__
- Imprecise Duplicate Import Check
- Incorrect error messages during compilation
- overriding allocator does not set global lock position causing crash in codegen HOT 2
- meta: tracker for overriding storage allocator bugs HOT 2
- compiler panic on indexing empty literal arrays
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vyper.