Comments (2)
Hello @lastperson, and thank your for raising that issue.
As explained in the link you share, the goal it to make the beacon proxy ERC-1967 compliant. While its technically correct that "Immutable variable could also be read from the proxy directly, just need to know the location in code.", I think the just is not as simple as you make it sound. The version of the code, on the compiler used, on the compiler settings, on the targetted evm version .... all these thing can change the location.
Being able to access this info is not a theoretical issue. The upgrades plugin activlly relies on that.
I would also put a grain of salt to the claim that "Proxies are meant to be deployed as cheap as possible". I don't think that is true, particularly with Beacon Proxies. If you want a cheap deployment, use a non-upgradeable clone. Features, such as upgrdeability have a cost, both at deployment and runtime. Additionnally, I think deployment cost is a side effect, and the main issue is execution cost. Likelly your contract is going to me used multiple times, and the overhead of the Beacon design is particularly expensive. That is the most expensive of the proxy to run. This makes me think that if you are ready to pay that extra cost for functionnality, maybe the additional sstore is not such an issue compared to the services provided.
from openzeppelin-contracts.
I would also put a grain of salt to the claim that "Proxies are meant to be deployed as cheap as possible". I don't think that is true
Strongly agree with this. It's cool to find potential optimizations but in cases like these, there's off-chain infra relying on contracts following the standard that would be affected by non-compliant proxies.
Essentially, any ERC is a product of community consensus. Particularly with ERC-1967, that consensus included the storage slots. Multiple services would rely on that given we agreed it's standard.
Assuming the deployment cost difference is indeed 24000 gas units (haven't checked), that would still be ~36 dollars at 100 gwei gas price and ETH being at 15,000 USD. I would say it's non preferrable, but I would balance it against breaking infrastructure depending on an ERC we've previously had consensus at.
Things get less expensive in L2s of course.
from openzeppelin-contracts.
Related Issues (20)
- A new utility contract to enhances the security of deploying and managing upgradable contracts in Hardhat plugin HOT 8
- Codecov result don't show up in the PR summary anymore
- Incorrect link formatting in NatSpec causing broken URLs HOT 2
- Consider making `Votes._moveDelegateVotes` internal virtual
- Consider using transient storage in Governor and AccessManager HOT 1
- Incorrect pragma
- bugs in the docs code? ERC721 HOT 1
- AccessManager restricted should not default to admin role HOT 1
- Mark AccessManagerUpgradeable abstract or implement initializer function HOT 1
- Fix API documentation broken links in the doc-site
- Make `_moveDelegateVotes` internal in Votes.sol HOT 1
- Request to Add Upgradable Interfaces in contracts/interfaces Directory of the OpenZeppelin Contracts Upgradeable Repository HOT 2
- Semi abstracted nonce support
- Low level call library HOT 3
- UUPSUpgradeable is not ERC1882 (draft) compatible, but rather only ERC1967 compatible. HOT 2
- ERC1967Utils and/or UUPSUpgradeable should enforce that only ADMIN is allowed to upgrade the implementation HOT 1
- I Can't verified contract in Coredao HOT 1
- `ERC1155`: reorder of `KeyType`s in `_balances` HOT 3
- Meta: FAQ
- Feature Request: removeAt(index) in EnumerableSet
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 openzeppelin-contracts.