Deciphering the dilemma around Upgradeable Smart Contracts

Deciphering the dilemma around Upgradeable Smart Contracts

I was part of an interesting discussion the other day with a group of Smart Contract devs and the topic of discussion was - Upgradeable Contracts.

?? Dev 1 who wanted to start developing his smart contracts was quite confused about whether or not he should make it upgradeable.

He believed his smart contracts might need additional functionalities in the future which is why upgradable contracts are perhaps the right choice.

However, he wasn’t sure if he should proceed with it, given the complexity of dealing with Upgradeable contracts.

?? ?? Dev 2: ?????????????????????? ?????????????????? ????????’?? ???????????? ?? ???????? ???????? ???? ???????? ?????????? ?????????????????? ???????????????????? ???????????????????? ???? ???????? ?????????????????? ?????? ?????????? ?????? ???? ?????????????????????? ????????-???????????????? ????????.

???????? ?????????? ???? ?? ?????? ???????? ?????????? ???? ?????????????? ???????????????????? ???? ???? ???????????????????? ???????????????????????????? ?????????????????? ???????? ???????????? ???????????? ???? ??????????????, ?????????? ???????? ???????? ???????????? ???? ????????.

?? ?? Dev 3:???? ?????? ????????’?? ???????? ?????????? ?????? ???????? ?????????? ???????????????? ?????????????????? ?????? ?????????? ?????? ?????????????? ???????? ?????? ?????????????????????????????? ?????????? ???????? ????, ?????????????????????? ?????????????????? ?????? ?????? ?????????? ????????????.

?????????????????????? ?????????????????? ???? ???????? ?????? ?????? ?????? ???????? ???? ?????????? ?????????????????? ?????????? ??????’?? ???? ????????????????????.

????????????????????????, ???? ??????’?? ???????????? ???????? ???????? ???? ?????????????? ?????????????????????? ??????????????????, ?????? ???????? ???? ???????? ???????? ???????????? ?????????????????? ?????????????????? ?????? ?????????? ?????????? ?????????????? ???????? ???????????? ???????? ?????????????? ????????????????????, ???????????? ???????????????? ?????? ?????? ?????????? ???????? ????.

???????? ???? ?? ??????????? ??

? It has been a well-known theory in the Smart Contract world that ?????? ???????????? ???????? ?????????? ?????????? ???????????????? ???? ???????????? ???? ???????????????? ???? ???????????? ???????????????????? ?????????? ?????????????????? ?????? ????????.

And it’s quite true, to some extent, as we don’t really need to reinvent the wheel every time, and the security of smart contracts should always be a top priority.

? However, smart contracts, despite their incredible powers of handling money or being immutable, are pieces of code too. And having some bugs in the code is inevitable.

As of now, ?????????????????????? ?????????????????? ?????? ?????? ???? ?????? ???????? ?????????????????? ?????????? ???? ???????? ???? ???????? ?????????? ?????? ???? ?????????????? ?????????? ???????? ???????? ???? ?????????????????? ?????? ????????????????, (in most cases).

? Avoiding Upgradeable contracts just because they might add to the complexity of your existing smart contract architecture is probably a bad idea, especially when you know you might need one.

? ?????????????????????????? ?????? ?????????????????????????? ???? ?????????????????????? ?????????? ?????????????????? ???? ???????? ???? ???????? ?????? ???????????? ????????????, ?????????????? ???? ???????????????? ????.

? Additionally, I believe smart contract upgrade patterns have now seen quite a journey starting from the Eternal Storage mechanism to the recent ones like Transparent Upgradeable proxy or UUPS.

Watch this video and enjoy, the very cool Thomas Wiesner , taking us to the entire journey of upgradeable smart contracts and how they evolved over time.

?? Huge shoutout to Thomas for such amazing content. ??


Therefore now we have a much safer procedure for upgrading contracts and amazing libraries and tools by Openzeppelin which simplifies the entire procedure.

Check out this treasure on Upgradeable smart contracts Here by OpenZeppelin

? While not every contract needs to be upgradeable, the ones that need to be should be upgradeable.

??The right question for such contracts, however, isn’t whether or not they should be upgradeable.

Instead ??

How should we Upgrade Smart Contracts Securely?

For instance:

?? If you accumulate all the upgradeable capability of your smart contracts to a simple address (EOA), then it's definitely not a secure contract.

?? One safe way of upgrading such smart contracts is to use ProxyAdmin contracts and a Multisig, thus eliminating a single authority control over upgrades.

?? Upgrading through on-chain governance is another secure, effective, and decentralized way of doing it.

???????? ???? ?????? ???????????

Drop your comments below and let’s try to start an effective discussion around this classic dilemma of an Upgradeable contract. ??

Pushpit Bhardwaj

Distributed Systems Engineer | Full-Stack/ Blockchain/ CloudOps | 7x hackathon ??

2 年

This was a good read! Have you had the chance to explore the latest EIP2535 Diamond Standard?

回复
Yonadav Vinograd

Cryptography | Web3 | Blockchain Security | Smart Contracts Audits | Solidity | Architecture | Bitcoin & Ethereum

2 年

also, upgradeability coming instead of decentralization because all logic can be changed. not trustless at all...

回复
SHANTANU SONTAKKE

Solidity Auditor @ Zokyo | Blockchain Security Researcher | Co-Founder & CEO @ AIApocalypto | Speaker, Mentor & Investor

2 年

If you make your contracts upgradeable, you violate a core blockchain principle that code is immutable, and add an additional layer that users have to trust will not get exploited(there are a lot of examples in which upgrading the contracts led to introduction of new bugs in the smart contract such as in the 190 Million dollars Nomad bridge hack, see- https://www.certik.com/resources/blog/28fMavD63CpZJOKOjb9DX3-nomad-bridge-exploit-incident-analysis ) Checkout this article as to how upgraeable or metamorphic contracts can be exploited- https://a16zcrypto.com/metamorphic-smart-contract-detector-tool/

回复
Veljko Tekelerovi?

Products | Mobile | Open source | Bitcoin

2 年

What if we make it from scratch without the need to pay the air ? ?? Ethereum world is psychologically collapsing… Time to move away from a fog of nothing ??

回复
Eduard Kotysh

Former CEO & Founder of Solidified (acquired) | Entrepreneur and Advisor

2 年

Upgradeability is a bug, not a feature. It breaks trustlessness and immutability, core principles of smart contracts. The more complex the upgradable mechanism (ie Diamonds), the easier it is to exploit. Put failsafes into the code to halt unintended behavior (in case of bugs) and let users migrate to a new contract as needed

要查看或添加评论,请登录

Zaryab Afser的更多文章

社区洞察

其他会员也浏览了