# Upgrade smart contracts 2: delegatecall **Published by:** [Hicss](https://paragraph.com/@freesuton/) **Published on:** 2022-01-18 **URL:** https://paragraph.com/@freesuton/upgrade-smart-contracts-2-delegatecall ## Content Delegatecalldelegatecall is a low level function similar to call.When contract A executes delegatecall to contract B, B's code is executed with contract A's storage, msg.sender and msg.value.Common Call: When we call B's function from A, B's code is executed with contract B's storage. x in A is still 0.Delegatecall: When we call B's function from A, B's code is executed with contract A's storage. x in A will be 1.So we get a method to update the contract.We can just change the address in A to call different contracts between B and B2 by using delegatecall.Example Code: ## Publication Information - [Hicss](https://paragraph.com/@freesuton/): Publication homepage - [All Posts](https://paragraph.com/@freesuton/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@freesuton): Subscribe to updates - [Twitter](https://twitter.com/freesuton): Follow on Twitter