-
-
Notifications
You must be signed in to change notification settings - Fork 815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VIP: msg.data
#1181
Comments
👍 exposing |
I looked at the implementation of this and it gets a bit tricky with the fact that we do not allow any length
raw_call(self.implementation, msg.data, outsize=0, gas=msg.gas, delegate_call=True) # no assertions occur
a: bytes[1024] = msg.data # will throw if CALLDATASIZE > 1024 cc @fubuloubu |
What about if I use it directly? Would the accessor be the bound that would check for assert? What if I access multiple parts of it? |
The problem with allowing this is that you lose the property of being able to calculate a precise bound on gas consumption. One alternative proposal would be to allow |
I think we lose this with |
I think an issue with using slice is it makes it easier for the programmer to make mistakes, i.e. failing silently. Perhaps a middle ground is having the syntax be |
Utilizing EDIT: see ethereum/consensus-specs#1357 |
It's on the path for the next few months, but we're accepting contributions if anyone wants to get involved! It shouldn't be too difficult. |
Simple Summary
Add support of
msg.data
, which returns the complete calldata. This enables a proxy for an upgradable pattern.Abstract
Add a new global variable
msg.data
similar to the one of Solidity.Motivation
This enables a proxy for an upgradable pattern with which users don't need to take care of the proxy contract. See the example code below.
Specification
msg.data
returns abytes
which represents a complete calldata using CALLDATA opcode.This is an example code of a proxy contract. (ref OpenZeppelin Proxy.sol)
proxy contract
delegatee contract
(NOTE:
dummyVal
s are there to make up for the slots of the variables used only in the proxy. Instead, the slots of these variables are explicitly set with inline assembly in Solidity).Backwards Compatibility
It's a new feature and backward compatible.
Dependencies
None
Copyright
Copyright and related rights waived via CC0
The text was updated successfully, but these errors were encountered: