# Error: invalid address

**URL:** <https://forum.openzeppelin.com/t/error-invalid-address/12921>\
**Category:** Upgrades\
**Created:** [July 23, 2021, 12:56am UTC](https://forum.openzeppelin.com/t/error-invalid-address/12921 "2021-07-23T00:56:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AngeloTree](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/angelotree/32/6980_2.png) [@AngeloTree](https://forum.openzeppelin.com/u/AngeloTree)\
**Post date:** [July 23, 2021, 12:56am UTC](https://forum.openzeppelin.com/t/error-invalid-address/12921/1 "2021-07-23T00:56:29Z")

</div>

Hello. I'm new to doing tests and currently trying to do a test with the initialize for the upgrade openZeppelin contracts. Here is the error I'm getting - [https://gyazo.com/577c38e953d125110042a75f8b37913a](https://gyazo.com/577c38e953d125110042a75f8b37913a)

Here is my code.

```auto
// migrations/3_deploy_upgradeable_box.js
const { deployProxy } = require('@openzeppelin/truffle-upgrades');

const Box = artifacts.require('Box');

module.exports = async function (deployer) {
  await deployProxy(Box, [42], { deployer, initializer: 'store' });
};

```

```auto
// migrations/4_upgrade_box.js
const { upgradeProxy } = require('@openzeppelin/truffle-upgrades');

const Box = artifacts.require('Box');
const BoxV2 = artifacts.require('BoxV2');

module.exports = async function (deployer) {
    const existing = await Box.deployed();
    await upgradeProxy(existing.address, BoxV2, { deployer });
};

```

```auto
// migrations/5_deploy_upgradeable_adminbox.js
const { deployProxy } = require('@openzeppelin/truffle-upgrades');

const AdminBox = artifacts.require('AdminBox');

module.exports = async function (deployer) {
  await deployProxy(AdminBox, ['0x287895F1cA934e95731E9BF8c7DfA8EBca699028'], { deployer, initializer: 'initialize' });
};

```

```auto
// test/Box.test.js
// Load dependencies
const { expect } = require('chai');

// Import utilities from Test Helpers
const { BN, expectEvent, expectRevert } = require('@openzeppelin/test-helpers');

// Load compiled artifacts
const Box = artifacts.require('Box');
const AdminBox = artifacts.require('AdminBox');

contract('AdminBox', function([owner, other]) {
    // Use large integers ('big numbers')
    const value = new BN('52');

    beforeEach(async function () {
        this.box = await AdminBox.new({ from: owner });

        await this.box.initialize({ from: owner });
    });

    // Test case
    it('retrieve returns a value previously stored', async function() {
        // Store a value
        await this.box.store(value, { from: owner });

        // Use large integer comparisons
        expect(await this.box.retrieve()).to.be.bignumber.equal(value);
    });

})

```

---

<div class="post-metadata">

**Author:** ![Skyge](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/skyge/32/343_2.png) [@Skyge](https://forum.openzeppelin.com/u/Skyge)\
**Post date:** [July 23, 2021, 7:08am UTC](https://forum.openzeppelin.com/t/error-invalid-address/12921/2 "2021-07-23T07:08:50Z")

</div>

I think you can have a look at this tutorial: [OpenZeppelin Upgrades: Step by Step Tutorial for Truffle - General / Guides and Tutorials - OpenZeppelin Community](https://forum.openzeppelin.com/t/openzeppelin-upgrades-step-by-step-tutorial-for-truffle/3579)

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [July 26, 2021, 9:24pm UTC](https://forum.openzeppelin.com/t/error-invalid-address/12921/3 "2021-07-26T21:24:04Z")

</div>

This error is unrelated to Upgrades Plugins.

In order to become a good smart contract developer you will need to learn to debug! The error message is quite clear: something that should be an address is not a valid address. There is even a line number indicating where the error is triggered. Use all of this information to find the source of the error.
