openzeppelin-test-environment icon indicating copy to clipboard operation
openzeppelin-test-environment copied to clipboard

Allow to specify accounts deterministically using mnemonic

Open ylv-io opened this issue 4 years ago • 2 comments

Community member requested this functionality.

ylv-io avatar Apr 15 '20 17:04 ylv-io

Here might be some useful information.

You can already do this with OpenZeppelin SDK (which I would assume is more or less the same as the test environment).

You can use HDWalletProvider from Truffle and register it over your Web3 instance.

Here is an example. This example does it with a command-line script, not the test environment though :

https://github.com/Dawn-Protocol/dawn-erc20-erc777/blob/master/src/utils/deploy.ts#L78

HDWalletProvider supports both raw private keys and mnemonics.

miohtama avatar Apr 27 '20 12:04 miohtama

Thanks @miohtama! That is certainly a way to do. The only small issue I see is that you have to fund your mnemonic accounts if you run them over Ganache.

ylv-io avatar Apr 27 '20 17:04 ylv-io