0

I am looking through Brownie and Hardhat but see nothing in the docs that suggests this. I have tried looking through Authereum and other wallets to no avail.

3 Answers 3

1

Yes, it is possible. It depends on the particular use case.

  • @truffle/hdwallet-provider, given a mnemonic it could generate several accounts using numberOfAddresses.

  • ganache-cli accepts a command line parameter --accounts that can be used to specify how many accounts will be created.

0

https://www.youtube.com/watch?v=xexCCBbnLQc

This video explains how to do something like that using web3. Might wanna check it out.

It takes care of the wallet creation part, but if you want to fund the wallets, you're gonna need a source for the funds.

Do you want them to be funded in your local blockchain? If yes, you can simply configure hardhat to use the addresses that you generated for the wallet that you just created for yourself and hardhat will fund the wallets for you.

Do you want them to be funded in a testnet? Then a faucet is your best bet. You will then have to find a way to programmatically ask a faucet for funds.

Creating a wallet is otherwise a straightforward process. No need to even connect to a blockchain.

2
  • how about for mainnet? Sep 19, 2021 at 23:15
  • programmatically send money from somewhere into these contracts. I suggest you to do it in a single transaction (it should be doable through a smart contract) or you'll go broke from the gas fees.
    – ardilgulez
    Oct 1, 2021 at 6:43
0

you can use this to create multiple accounts just like I did here. https://web3js.readthedocs.io/en/v1.5.2/web3-eth-accounts.html you can easily loop through this line in 500 times, tried it out here: https://github.com/OnahProsperity/1000ethAddress and it worked. for transferring to multiple address you can have a function in your contract to do that this way.

function transfer_To_Multi_Wallet(address[] memory _user) public payable {        
    for (uint256 i = 0; i < _user.length; i++) {
        address wallet = _user[i];
        uint256 amount = msg.value;
        payable(wallet).transfer(amount);
        emit tran(wallet, amount);
    }
}

this will loop through all the input array of addresses. just suggestion. note you might need to add some require statement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.