# Updating contract variable that references another contract

**URL:** <https://forum.openzeppelin.com/t/updating-contract-variable-that-references-another-contract/37595>\
**Category:** Upgrades\
**Tags:** proxies\
**Created:** [August 24, 2023, 7:11am UTC](https://forum.openzeppelin.com/t/updating-contract-variable-that-references-another-contract/37595 "2023-08-24T07:11:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabrielstoica](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/gabrielstoica/32/18594_2.png) [@gabrielstoica](https://forum.openzeppelin.com/u/gabrielstoica)\
**Post date:** [August 24, 2023, 7:11am UTC](https://forum.openzeppelin.com/t/updating-contract-variable-that-references-another-contract/37595/1 "2023-08-24T07:11:10Z")

</div>

Hi everyone!

I'm dealing with the current situation right now and want to check with you. Working with an **UUPS smart contract** where the storage layout looks like this:

```auto
address public firstVar;
uint256 public secondVar;
ContractA public contractA;

```

`ContractA` is another UUPS smart contract which I want to rename to `ContractB`. So the new storage layout will have the following structure:

```auto
address public firstVar;
uint256 public secondVar;
/// @custom:oz-renamed-from contractA
ContractB public contractB;

```

Since `ContractB` will have the same storage layout/methods and `contractB` (formerly `contractA`) holds only the contract address, is it safe to upgrade it?

Thanks!

---

<div class="post-metadata">

**Author:** ![barakman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/barakman/32/855_2.png) [@barakman](https://forum.openzeppelin.com/u/barakman)\
**Post date:** [August 24, 2023, 7:19am UTC](https://forum.openzeppelin.com/t/updating-contract-variable-that-references-another-contract/37595/2 "2023-08-24T07:19:28Z")

</div>

> [@gabrielstoica](#):
>
> is it safe to upgrade it?

Yes, it is safe to upgrade it.
