Openzeppelin accounts not working

Going through the setup now…

.gitignore
.env 
network.js

and discovered this command $ npx openzeppelin accounts is not working

Reference: https://docs.openzeppelin.com/sdk/2.5/public-deploy

1 Like

Hi @pkr,

openzeppelin accounts is in OpenZeppelin SDK 2.5.3.

$ openzeppelin --version
2.5.3
$ openzeppelin accounts
? Pick a network development
Accounts for dev-1568939673368:
Default: 0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
All:
- 0: 0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
- 1: 0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0
- 2: 0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b
- 3: 0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d
- 4: 0xd03ea8624C8C5987235048901fB614fDcA89b117
- 5: 0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC
- 6: 0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9
- 7: 0x28a8746e75304c0780E011BEd21C72cD78cd535E
- 8: 0xACa94ef8bD5ffEE41947b4585a84BdA5a3d3DA6E
- 9: 0x1dF62f291b2E969fB0849d99D9Ce41e2F137006e

Thank you @abcoathup – looks like I have the older version

$ oz --version
2.5.2

How do i upgrade to 2.5.3

1 Like

Hi @pkr,

To upgrade to the current version of OpenZeppelin SDK (2.5.3)

npm uninstall -g @openzeppelin/cli
npm install -g @openzeppelin/cli

Housekeeping: I moved this into a new topic.

1 Like

Thank you again, uninstalled and installed, looks like oz has been upgraded and able to retrieve accounts.

$ oz --version
2.5.3
$ oz accounts
? Pick a network development
Accounts for dev-1568949671601:
Default: 0x49E200AE5ed4696DE7Cc4843ebB1a767F5e0E14D
All:
- 0: 0x49E200AE5ed4696DE7Cc4843ebB1a767F5e0E14D
- 1: 0x2059F0FA024eC1c1B149f11850Fbf35c4709bD25
- 2: 0x8430E16DBd726c714C82Ca7A6D9Eef7F4BD80137
- 3: 0x8E30c1aC4c826eEc766631e93fED2B618beCB94c
- 4: 0xBf59054613E7e11C38A38E78A0E5f9b974cd81d3
- 5: 0xd747025E6208C7d81945f509Ab75B4AF47a8Eb51
- 6: 0x23942f04BD7cbf18713cCda24139AEB69E8Fb2a4
- 7: 0x8932f0773308cd44b381De1Fb4444e69d876fce7
- 8: 0x14A7f0D6fFe2e1B0a8a6dD0999698b53BCdFe179
- 9: 0x1919f0838C9Df8f2c83d56700AA3d67dAf20036E

Looks like the default account generated for other networks (Ropsten, Rinkeby, Mainnet) is different to what is listed here.

And is there way to generate more than one account w/ the same mnemonic for the above non-dev networks?

1 Like

Hi @pkr,

The accounts generated for Ropsten/Rinkeby network use the mnemonic that you created.

ganache-cli generates its accounts using it's own mnemonic.
If you run using ganache-cli -d then you use a deterministic mnemonic.
You can also run using ganache-cli -m and specify a mnemonic.
See ganache-cli options for more details: https://github.com/trufflesuite/ganache-cli#options

To expose additional addresses when using HDWalletProvider add the default address, e.g. 0 and the number of addresses to expose, e.g. 5.
provider: () => new HDWalletProvider(process.env.DEV_MNEMONIC, "https://ropsten.infura.io/v3/" + infuraProjectId, 0, 5),

This is in the documentation but sounds like it wasn't clear enough. Also I found a broken link.

https://docs.openzeppelin.com/sdk/2.5/public-deploy#configure-networks-js
To expose additional addresses from the same mnemonic set num_addresses in your config. ...
See the truffle-hdwallet-provider repository for details.

1 Like

Yes, I am using this option currently. If i am using -m I don't need to use -d right?

I have updated my networks.js to generate 5 accounts and changed the other mnemonics.

1 Like

Hi @pkr,

Yes, you can use either but not both at the same time.

You can use:

  • ganache-cli -d for a fixed mnemonic or
  • ganache-cli -m "add your own mnemonic here" to use your own mnemonic
  • ganache-cli for ganache to generate a mnemonic
1 Like